1
1
// Copyright (C) 2000, 2001, 2003 Michael Bartl
2
2
// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 Ulf Lorenz
3
3
// Copyright (C) 2004, 2005 Andrea Paternesi
4
// Copyright (C) 2007, 2008 Ben Asselstine
4
// Copyright (C) 2007, 2008, 2009 Ben Asselstine
5
5
// Copyright (C) 2007, 2008 Ole Laursen
7
7
// This program is free software; you can redistribute it and/or modify
63
63
//! Provides a +1 strength to all Army units in a fortified Stack.
64
64
FORTIFY = 0x00002000,
66
static guint32 bonusFlagsFromString(const std::string str);
67
static std::string bonusFlagsToString(const guint32 bonus);
68
static ArmyBase::Bonus bonusFlagFromString(const std::string str);
69
static std::string bonusFlagToString(const ArmyBase::Bonus bonus);
71
67
//! Various kinds of statistics that an instance of Army unit has.
115
109
//! Set the strength of the army.
116
110
void setStrength(guint32 strength) {d_strength = strength;}
112
//! Set how much XP this unit is worth when killed.
113
void setXpReward(double xp_value){d_xp_value = xp_value;}
120
118
//! Returns how many gold pieces this Army needs per turn.
121
119
guint32 getUpkeep() const {return d_upkeep;}
140
138
guint32 getStrength() const {return d_strength;}
142
140
//! Get the distance this army can see on a hidden map.
142
* As this army walks on the map, it defogs the map with this radius.
143
144
guint32 getSight() const {return d_sight;}
146
//! Gets an easy to read string that represents the army's bonuses.
145
147
std::string getArmyBonusDescription() const;
147
//! Set how much XP this unit is worth when killed.
148
void setXpReward(double xp_value){d_xp_value = xp_value;}
150
149
//! Returns the number of XP that killing this Army garners it's killer.
151
150
double getXpReward() const {return d_xp_value;}
154
//! Convert an ArmyBase::Bonus string to a bitwise OR'd value.
156
* Converts a string containing the string representations of one
157
* or more ArmyBase::Bonus values to a bitwise OR'd value of those
158
* ArmyBase::Bonus values. The terms are separated with a pipe `|'.
160
static guint32 bonusFlagsFromString(const std::string str);
162
//! Convert a series of ArmyBase::Bonus enum values to a string.
164
* Converts a bitwise OR'd value that represents many ArmyBase::Bonus
165
* enumerated values into a string, where the terms are separated by a
168
static std::string bonusFlagsToString(const guint32 bonus);
170
//! Convert an ArmyBase::Bonus string to it's enum value.
172
* Converts a string containing a string representation of an
173
* ArmyBase::Bonus enumerated value, and converts it to it's enumerated
176
static ArmyBase::Bonus bonusFlagFromString(const std::string str);
178
//! Convert an ArmyBase::Bonus enum value to a string.
179
static std::string bonusFlagToString(const ArmyBase::Bonus bonus);
181
//! Convert a Tile::Type string to a bitwise OR'd value.
183
* Converts a string containing the string representations of one
184
* or more Tile::Type values to a bitwise OR'd value of those
185
* Tile::Type values. The terms are separated with a pipe `|'.
187
static guint32 moveFlagsFromString(const std::string str);
189
//! Convert a series of Tile::Type enumerated values to a string.
191
* Converts a bitwise OR'd value that represents many Tile::Type
192
* enumerated values into a string, where the terms are separated by a
195
static std::string moveFlagsToString(const guint32 move_bonus);
154
199
//! Generic method for saving Army base data.