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
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.
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.
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
41 //! A local human Player.
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.
50 class RealPlayer : public Player
54 //! Default constructor.
55 RealPlayer(std::string name, guint32 armyset, Gdk::Color color,
56 int width, int height, Player::Type type = Player::HUMAN,
60 RealPlayer(const Player&);
62 //! Loading constructor.
63 RealPlayer(XML_Helper* helper);
66 virtual ~RealPlayer();
68 virtual bool isComputer() const {return false;};
70 virtual bool save(XML_Helper* helper) const;
72 virtual void abortTurn();
74 virtual bool startTurn();
76 virtual void endTurn();
78 virtual void invadeCity(City* c);
80 virtual bool chooseHero(HeroProto *hero, City* c, int gold);
82 virtual Reward *chooseReward(Ruin *ruin, Sage *sage, Stack *stack);
84 virtual void heroGainsLevel(Hero * a);
86 virtual bool chooseTreachery (Stack *stack, Player *player, Vector <int> pos);
87 virtual Army::Stat chooseStat(Hero *hero);
89 virtual bool chooseQuest(Hero *hero);
91 bool d_abort_requested;
95 #endif // REAL_PLAYER_H