lamoule.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 LAMOULE_H
00030 #define LAMOULE_H
00031 #include "../plugin.h"
00032 #include "../botkernel.h"
00033 
00034 #ifndef HAVE_TINYXML
00035 #include "../tinyxml/tinyxml.h"
00036 #else 
00037 #include <tinyxml.h>
00038 #endif
00039 
00040 
00041 #include "admin.h"
00042 #include "usersinfos.h"
00043 #include <iostream>
00044 using namespace std;
00045 
00047 typedef enum {
00048         TOTAL,AVERAGE
00049 } sort_criterion;
00050 
00057 class Lamoule : public Plugin
00058 {
00059 private:
00061    TiXmlDocument * doc ;
00063    TiXmlNode* root;
00065    void initFile();
00067    unsigned int nextScore;
00069    int MAX_SCORE;
00071    int FIRST_FLOOR;
00073    int SECOND_FLOOR;
00074 public:
00076         Lamoule(BotKernel*);
00078    vector<string> getTopShot();
00080    void setTopShot(string,string,string);
00082    void addPlayer(string,unsigned int);
00084    char increaseScore(string,int,unsigned int,bool);
00086    vector<TiXmlElement *> sort(sort_criterion,int);
00088    vector<string> get5first(sort_criterion,int);
00090    vector<string> getInfosPlayer(string,int);
00092    bool deletePlayer(string);
00094    void purifyFile(int);
00096    bool setNextScore(int);
00098    int generateScore() ;
00099 };
00100 
00101 
00102 #endif
00103 

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