1 // Copyright (C) 2000, 2001, 2003 Michael Bartl
2 // Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 Ulf Lorenz
3 // Copyright (C) 2004, 2005 Andrea Paternesi
4 // Copyright (C) 2007, 2008, 2009 Ben Asselstine
5 // Copyright (C) 2007, 2008 Ole Laursen
7 // This program is free software; you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation; either version 3 of the License, or
10 // (at your option) any later version.
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU Library General Public License for more details.
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22 #ifndef ARMY_PROTO_BASE_H
23 #define ARMY_PROTO_BASE_H
34 class ArmyProtoBase : public ArmyBase
39 ArmyProtoBase(const ArmyProtoBase& armyprotobase);
41 //! Loading constructor.
42 ArmyProtoBase(XML_Helper* helper);
44 //! Default constructor. Create an empty army prototype base.
52 void setTypeId(guint32 type_id) {d_type_id = type_id;};
54 //! Sets the descriptive text for this Army.
55 void setDescription(std::string text) {d_description = text;};
57 //! Set the gold pieces needed to make an Army unit of this kind.
58 void setProductionCost(guint32 production_cost)
59 {d_production_cost = production_cost;}
61 //! Set the gold pieces needed to add this Army to a city's production.
62 void setNewProductionCost(guint32 new_production_cost)
63 {d_new_production_cost = new_production_cost;}
65 //! Sets the armyset id for this army.
66 void setArmyset(guint32 id) {d_armyset = id;};
68 //! Set the army bonus of the army prototype.
69 void setArmyBonus(guint32 bonus) {d_army_bonus = bonus;};
71 //! Set the move bonus.
72 void setMoveBonus(guint32 bonus) {d_move_bonus = bonus;};
74 //! Set the movement points of the army.
75 void setMaxMoves(guint32 moves) {d_max_moves = moves;};
77 //! Set the sight of the army.
78 void setSight(guint32 sight) {d_sight = sight;};
80 //! Set the name of the Army.
81 void setName(std::string name){d_name = name;}
83 //! Set how many turns this unit type needs to be produced.
84 void setProduction(guint32 production){d_production = production;};
89 //! Get the Id of the Armyset to which the Army's type belongs.
90 guint32 getTypeId() const {return d_type_id;}
92 //! Returns the descriptive text of this Army.
93 std::string getDescription() const {return _(d_description.c_str());}
95 //! Returns how much gold making one of these army units costs.
96 guint32 getProductionCost() const {return d_production_cost;}
98 //! Returns how much gold setting up the production costs
100 * @return The amount of gold pieces required to add this Army
101 * into the City's suite of 4 production slots.
103 guint32 getNewProductionCost() const {return d_new_production_cost;}
105 //! Returns the armyset id for this army.
106 guint32 getArmyset() const {return d_armyset;};
108 //! Returns the name of the Army.
109 std::string getName() const {return _(d_name.c_str());};
111 //! Returns how many turns this Army needs to be produced.
112 guint32 getProduction() const {return d_production;};
115 //! Callback method for loading this object from an opened file.
116 bool saveData(XML_Helper* helper) const;
118 //! The name of the Army unit. e.g. Scouts.
121 //! The index of the Army prototype's index in it's Armyset.
124 //! The description of the Army unit.
125 std::string d_description;
127 //! How many gold pieces needed to create an army of this kind.
129 * Every time an army unit is created of this kind, it costs the
130 * player this many gold pieces.
132 guint32 d_production_cost;
134 //! How many gold pieces needed to add this Army to a city's production.
136 * If d_production_cost is over zero, then the Army can be purchased.
137 * If not, then the Army unit cannot be incorporated into a
138 * City's production at any price.
140 * This value does not change during gameplay.
142 guint32 d_new_production_cost;
144 //! How many turns the Army unit takes to be produced in a City.
146 * This value must be above 0. Normal values for d_production are
148 * This value does not change during gameplay.
150 guint32 d_production;
152 //! The armyset to which this army prototype belongs.
157 #endif // ARMY_PROTO_BASE_H