survey.h

Go to the documentation of this file.
00001 /*
00002 #########################################################################
00003 #
00004 #  This file is part of trustyRC.
00005 #
00006 #  trustyRC, fully modular IRC robot 
00007 #  Copyright (C) 2006-2008 Nicoleau Fabien 
00008 #
00009 #  trustyRC is free software: you can redistribute it and/or modify
00010 #  it under the terms of the GNU General Public License as published by
00011 #  the Free Software Foundation, either version 3 of the License, or
00012 #  (at your option) any later version.
00013 #
00014 #  trustyRC is distributed in the hope that it will be useful,
00015 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 #  GNU General Public License for more details.
00018 #
00019 #  You should have received a copy of the GNU General Public License
00020 #  along with trustyRC.  If not, see <http://www.gnu.org/licenses/>.
00021 #
00022 #########################################################################
00023 */
00024 
00029 #ifndef SURVEY_H
00030 #define CLASS_H
00031 #include "../plugin.h"
00032 #include "../botkernel.h"
00033 #include "admin.h"
00034 #include <iostream>
00035 using namespace std;
00036 
00038 typedef struct 
00039 {
00040    string channel;
00041    string question;
00042    unsigned int time;
00043    vector<string> answers;
00044    vector<int> results;
00045    vector<string> voters;   
00046    vector<plugin_function> functions;
00047    plugin_function countDown;
00048 } struct_survey;
00049 
00055 class Survey : public Plugin
00056 {
00057 private:
00059    vector<struct_survey> surveys;
00061    int getAnswerId(vector<string>,string);
00063    bool surveyRunning(string); 
00064 public:
00066         Survey(BotKernel*);
00068    bool launchSurvey(string,string,unsigned int,vector<string>);
00070    bool stopSurvey(string);
00072    bool vote(string,string,string);
00074    vector<string> finishSurvey(string);
00076    vector<plugin_function> getSurveyFunctions(string);
00078    bool setSurveyFunctions(string,vector<plugin_function>);
00080    plugin_function getCountDown(string);
00082    bool setCountDown(string,plugin_function);
00083 };
00084 
00085 
00086 #endif
00087 

Generated on Sun Aug 16 15:28:29 2009 for trustyRC by  doxygen 1.5.8