character team is not cached in iterator anymore (BUGFIX!)
[k8-i-v-a-n.git] / src / game / team.h
blob9796eaf7dbeb200b0d90a68fef3e59357a8ea421
1 /*
3 * Iter Vehemens ad Necem (IVAN)
4 * Copyright (C) Timo Kiviluoto
5 * Released under the GNU General
6 * Public License
8 * See LICENSING which should be included
9 * along with this file for more details
12 #ifndef __TEAM_H__
13 #define __TEAM_H__
15 #include "ivancommon.h"
17 #include <vector>
18 #include <list>
19 #include <map>
21 #include "typedef.h"
24 class outputfile;
25 class inputfile;
26 class character;
28 typedef std::vector<character *> charactervector;
31 class team {
32 public:
33 team ();
34 team (feuLong);
35 virtual ~team () {}
37 void SetRelation (team *, int);
38 int GetRelation (const team *) const;
39 void Hostility (team *);
40 /*feuLong*/int GetID () const { return ID; }
41 void SetID (/*feuLong*/int What) { ID = What; }
42 void Save (outputfile &) const;
43 void Load (inputfile &);
44 void SetLeader (character *What) { Leader = What; }
45 character *GetLeader () const { return Leader; }
46 //std::list<character *>::iterator Add (character *);
47 void Add (character *Who);
48 void Remove (character *Who);
49 //void Remove (std::list<character *>::iterator);
50 const std::list<character *> &GetMember () const { return Member; }
51 int GetKillEvilness () const { return KillEvilness; }
52 void SetKillEvilness (int What) { KillEvilness = What; }
53 truth HasEnemy () const;
54 int GetMembers () const { return Member.size(); }
55 int GetEnabledMembers () const;
56 void MoveMembersTo (charactervector &);
57 cfestring &GetName () const { return Name; }
58 void SetName (cfestring &newname) { Name = newname; }
60 private:
61 character *Leader;
62 std::map<feuLong, int> Relation;
63 std::list<character *> Member;
64 /*feuLong*/int ID;
65 int KillEvilness;
66 festring Name;
70 outputfile &operator << (outputfile &, const team *);
71 inputfile &operator >> (inputfile &, team *&);
74 #endif