server_new/party.h

Go to the documentation of this file.
00001 /* $Id:party.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 __PARTY_H
00015 #define __PARTY_H
00016 
00017 #include <string>
00018 #include <map>
00019 #include <list>
00020 using namespace std;
00021 
00022 #include "person.h"
00023 
00024 #define loopPartyPlayers(r,v) loopMap((r)->listPlayers(),v,class person)
00025 
00026 class party {
00027     string name;
00028     map<string,class person> players;
00029     int color;
00030     class army *capital;
00031 public:
00032     party();
00033 
00034     // Field : name
00035     const string getName() const;
00036     void setName(const string v);
00037 
00038     // Field : players
00039     class person& getPlayers(const string v);
00040     map<string,class person>& listPlayers();
00041     void setPlayers(class person &v);
00042     void delPlayers(const string v);
00043     const bool isPlayers(const string v) const;
00044 
00045     // Field : color
00046     const int getColor() const;
00047     void setColor(const int v);
00048 
00049     // Field : capital
00050     class army& getCapital() const;
00051     void setCapital(class army &v);
00052 
00053     void save(class channel &ch);
00054     void load(class channel &ch);
00055     void xml(ofstream &f, int l=0, int r=0);
00056 };
00057 
00058 // Repository
00059 
00060 #define loopPartys(v) loopMap(party_repo.listParty(),v,class party)
00061 
00062 class partyRepository {
00063     map<string,party> partys;
00064 public:
00065     class party& getParty(const string v);
00066     void setParty(class party& v);
00067     map<string,class party>& listParty();
00068     void delParty(const string v);
00069     const bool isParty(const string v) const;
00070     multimap<string, sigc::signal<void, class party& > > relations;
00071     bool load(class channel &ch);
00072     void save(class channel &ch);
00073 };
00074 
00075 extern partyRepository party_repo;
00076 
00077 #endif // __PARTY_H


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