server_new/person_items.h

Go to the documentation of this file.
00001 /* $Id:person_items.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 __PERSON_ITEMS_H
00015 #define __PERSON_ITEMS_H
00016 
00017 #include <string>
00018 #include <map>
00019 #include <list>
00020 using namespace std;
00021 
00022 #include "stat_amount.h"
00023 #include "action_level.h"
00024 
00025 #define loopPerson_itemsStats(r,v) loopMap((r)->listStats(),v,class stat_amount)
00026 #define loopPerson_itemsUsage(r,v) loopMapi((r)->listUsage(),v,class action_level)
00027 
00028 class person_items {
00029     class item *type;
00030     int damage;
00031     map<string,class stat_amount> stats;
00032     map<int,class action_level> usage;
00033     int maxUsage;
00034     int points;
00035     int position;
00036     class person *owner;
00037 public:
00038     person_items();
00039 
00040     // Field : type
00041     class item& getType() const;
00042     void setType(class item &v);
00043 
00044     // Field : damage
00045     const int getDamage() const;
00046     void setDamage(const int v);
00047 
00048     // Field : stats
00049     class stat_amount& getStats(const string v);
00050     map<string,class stat_amount>& listStats();
00051     void setStats(class stat_amount &v);
00052     void delStats(const string v);
00053     const bool isStats(const string v) const;
00054 
00055     // Field : usage
00056     class action_level& getUsage(const int v);
00057     map<int,class action_level>& listUsage();
00058     void setUsage(class action_level &v);
00059     void delUsage(const int v);
00060     const bool isUsage(const int v) const;
00061 
00062     // Field : points
00063     const int getPoints() const;
00064     void setPoints(const int v);
00065 
00066     // Field : position
00067     const int getPosition() const;
00068     void setPosition(const int v);
00069     const string showPosition() const;
00070 
00071     // Field : owner
00072     class person& getOwner() const;
00073     void setOwner(class person &v);
00074     int operator<(const class person_items &ck) const;
00075 
00076     void save(class channel &ch);
00077     void load(class channel &ch);
00078     void xml(ofstream &f, int l=0, int r=0);
00079 };
00080 
00081 #endif // __PERSON_ITEMS_H


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