initial commit, lordsawar source, slightly modified
[lordsawar] / src / real_player.h
1 // Copyright (C) 2003 Michael Bartl
2 // Copyright (C) 2002, 2003, 2004, 2005, 2006 Ulf Lorenz
3 // Copyright (C) 2004 Andrea Paternesi
4 // Copyright (C) 2004 John Farrell
5 // Copyright (C) 2004 Bryan Duff
6 // Copyright (C) 2006, 2007, 2008, 2009 Ben Asselstine
7 // Copyright (C) 2007, 2008 Ole Laursen
8 //
9 //  This program is free software; you can redistribute it and/or modify
10 //  it under the terms of the GNU General Public License as published by
11 //  the Free Software Foundation; either version 3 of the License, or
12 //  (at your option) any later version.
13 //
14 //  This program is distributed in the hope that it will be useful,
15 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
16 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 //  GNU Library General Public License for more details.
18 //
19 //  You should have received a copy of the GNU General Public License
20 //  along with this program; if not, write to the Free Software
21 //  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 
22 //  02110-1301, USA.
23
24 #ifndef REAL_PLAYER_H
25 #define REAL_PLAYER_H
26
27 #include <string>
28 #include <list>
29 #include <gtkmm.h>
30
31 #include "player.h"
32
33 class MoveResult;
34 class XML_Helper;
35 class City;
36 class HeroProto;
37 class Sage;
38 class Ruin;
39 class Stack;
40
41 //! A local human Player.
42 /** 
43  * This class implements the abstract Player class in a reasonable manner
44  * for local players. It is suitable for local human players, and AI players
45  * can derive from this class and overwrite the start_turn and other 
46  * callback methods for their own purposes.  For complete descriptions of
47  * the callback functions see the Player class.
48  */
49
50 class RealPlayer : public Player
51 {
52     public:
53
54         //! Default constructor.
55         RealPlayer(std::string name, guint32 armyset, Gdk::Color color, 
56                    int width, int height, Player::Type type = Player::HUMAN, 
57                    int player_no = -1);
58
59         //! Copy constructor.
60         RealPlayer(const Player&);
61
62         //! Loading constructor.
63         RealPlayer(XML_Helper* helper);
64
65         //! Destructor.
66         virtual ~RealPlayer();
67
68         virtual bool isComputer() const {return false;};
69
70         virtual bool save(XML_Helper* helper) const;
71
72         virtual void abortTurn();
73
74         virtual bool startTurn();
75
76         virtual void endTurn();
77
78         virtual void invadeCity(City* c);
79
80         virtual bool chooseHero(HeroProto *hero, City* c, int gold);
81
82         virtual Reward *chooseReward(Ruin *ruin, Sage *sage, Stack *stack);
83
84         virtual void heroGainsLevel(Hero * a);
85
86         virtual bool chooseTreachery (Stack *stack, Player *player, Vector <int> pos);
87         virtual Army::Stat chooseStat(Hero *hero);
88         
89         virtual bool chooseQuest(Hero *hero);
90
91         bool d_abort_requested;
92
93 };
94
95 #endif // REAL_PLAYER_H
96
97 // End of file