server/background.h

Go to the documentation of this file.
00001 /* $Id:background.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 __BACKGROUND_H
00015 #define __BACKGROUND_H
00016 
00017 #include <string>
00018 #include <map>
00019 #include <list>
00020 using namespace std;
00021 
00022 #include "skill.h"
00023 
00024 #define loopBackgroundSkills(r,v) loopMap((r)->listSkills(),v,class skill)
00025 
00026 class background {
00027     string name;
00028     int nr;
00029     string description;
00030     map<string,class skill> skills;
00031 public:
00032     background();
00033 
00034     // Field : name
00035     const string getName() const;
00036     void setName(const string v);
00037 
00038     // Field : nr
00039     const int getNr() const;
00040     void setNr(const int v);
00041     int operator<(const class background &ck) const;
00042 
00043     // Field : description
00044     const string getDescription() const;
00045     void setDescription(const string v);
00046 
00047     // Field : skills
00048     class skill& getSkills(const string v);
00049     map<string,class skill>& listSkills();
00050     void setSkills(class skill &v);
00051     void delSkills(const string v);
00052     const bool isSkills(const string v) const;
00053 
00054     void save(class channel &ch);
00055     void load(class channel &ch);
00056     void xml(ofstream &f, int l=0, int r=0);
00057 };
00058 
00059 // Repository
00060 
00061 #define loopBackgrounds(v) loopSingle(background_repo.listBackground(),v,class background,list)
00062 
00063 class backgroundRepository {
00064     map<string,background> backgrounds;
00065     int max_nr;
00066 public:
00067     backgroundRepository();
00068     class background& getBackground(const string v);
00069     void setBackground(class background& v);
00070     list<class background>& listBackground();
00071     void delBackground(const string v);
00072     const bool isBackground(const string v) const;
00073     multimap<string, sigc::signal<void, class background& > > relations;
00074     bool load(class channel &ch);
00075     void save(class channel &ch);
00076 };
00077 
00078 extern backgroundRepository background_repo;
00079 
00080 #endif // __BACKGROUND_H


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