server_new/skill.h

Go to the documentation of this file.
00001 /* $Id:skill.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 __SKILL_H
00015 #define __SKILL_H
00016 
00017 #include <string>
00018 #include <map>
00019 #include <list>
00020 using namespace std;
00021 
00022 #include "special.h"
00023 
00024 #define loopSkillSpecials(r,v) loopMap((r)->listSpecials(),v,class special)
00025 
00026 class skill {
00027     class background *background;
00028     string name;
00029     string description;
00030     map<string,class special> specials;
00031 public:
00032     skill();
00033 
00034     // Field : background
00035     class background& getBackground() const;
00036     void setBackground(class background &v);
00037 
00038     // Field : name
00039     const string getName() const;
00040     void setName(const string v);
00041 
00042     // Field : description
00043     const string getDescription() const;
00044     void setDescription(const string v);
00045 
00046     // Field : specials
00047     class special& getSpecials(const string v);
00048     map<string,class special>& listSpecials();
00049     void setSpecials(class special &v);
00050     void delSpecials(const string v);
00051     const bool isSpecials(const string v) const;
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 loopSkills(v) loopMap(skill_repo.listSkill(),v,class skill)
00061 
00062 class skillRepository {
00063     map<string,skill> skills;
00064 public:
00065     class skill& getSkill(const string v);
00066     void setSkill(class skill& v);
00067     map<string,class skill>& listSkill();
00068     void delSkill(const string v);
00069     const bool isSkill(const string v) const;
00070     multimap<string, sigc::signal<void, class skill& > > relations;
00071     bool load(class channel &ch);
00072     void save(class channel &ch);
00073 };
00074 
00075 extern skillRepository skill_repo;
00076 
00077 #endif // __SKILL_H


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