lamoule.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
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