00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 #ifndef __CULTURE_H
00015 #define __CULTURE_H
00016 
00017 #include <string>
00018 #include <map>
00019 #include <list>
00020 using namespace std;
00021 
00022 #include "guild.h"
00023 
00024 #define loopCultureGuilds(r,v) loopMap((r)->listGuilds(),v,class guild)
00025 
00026 class culture {
00027     string name;
00028     string description;
00029     map<string,class guild> guilds;
00030 public:
00031     culture();
00032 
00033     
00034     const string getName() const;
00035     void setName(const string v);
00036 
00037     
00038     const string getDescription() const;
00039     void setDescription(const string v);
00040 
00041     
00042     class guild& getGuilds(const string v);
00043     map<string,class guild>& listGuilds();
00044     void setGuilds(class guild &v);
00045     void delGuilds(const string v);
00046     const bool isGuilds(const string v) const;
00047 
00048     void save(class channel &ch);
00049     void load(class channel &ch);
00050     void xml(ofstream &f, int l=0, int r=0);
00051 };
00052 
00053 
00054 
00055 #define loopCultures(v) loopMap(culture_repo.listCulture(),v,class culture)
00056 
00057 class cultureRepository {
00058     map<string,culture> cultures;
00059 public:
00060     class culture& getCulture(const string v);
00061     void setCulture(class culture& v);
00062     map<string,class culture>& listCulture();
00063     void delCulture(const string v);
00064     const bool isCulture(const string v) const;
00065     multimap<string, sigc::signal<void, class culture& > > relations;
00066     bool load(class channel &ch);
00067     void save(class channel &ch);
00068 };
00069 
00070 extern cultureRepository culture_repo;
00071 
00072 #endif // __CULTURE_H