server_new/culture.h

Go to the documentation of this file.
00001 /* $Id:culture.h $ */
00002 /*
00003    Copyright (C) 2007 by Jurjen Stellingwerff <jurjen@stwerff.xs4all.nl>
00004    Part of the Moros Project http://moros.sourceforge.net/
00005 
00006    This program is free software; you can redistribute it and/or modify
00007    it under the terms of the GNU General Public License version 3.
00008    This program is distributed in the hope that it will be useful,
00009    but WITHOUT ANY WARRANTY.
00010 
00011    See the COPYING file for more details.
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     // Field : name
00034     const string getName() const;
00035     void setName(const string v);
00036 
00037     // Field : description
00038     const string getDescription() const;
00039     void setDescription(const string v);
00040 
00041     // Field : guilds
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 // Repository
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


Generated on Tue Jan 1 17:30:00 2008 for server_new/culture.h Source File by  doxygen   Visit the project page on SourceForge.net Logo