~ubuntu-branches/ubuntu/maverick/lordsawar/maverick

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
// Copyright (C) 2000, 2001, 2003 Michael Bartl
// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 Ulf Lorenz
// Copyright (C) 2004, 2005 Andrea Paternesi
// Copyright (C) 2007, 2008, 2009 Ben Asselstine
// Copyright (C) 2007, 2008 Ole Laursen
//
//  This program is free software; you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation; either version 3 of the License, or
//  (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU Library General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this program; if not, write to the Free Software
//  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 
//  02110-1301, USA.

#ifndef ARMY_PROTO_BASE_H
#define ARMY_PROTO_BASE_H

#include <gtkmm.h>
#include <string>

#include "defs.h"

class XML_Helper;

#include "armybase.h"

class ArmyProtoBase : public ArmyBase
{
    public:

	//! Copy constructor.
        ArmyProtoBase(const ArmyProtoBase& armyprotobase);

	//! Loading constructor.
        ArmyProtoBase(XML_Helper* helper);
        
	//! Default constructor.  Create an empty army prototype base.
	ArmyProtoBase();

	//! Destructor.
        ~ArmyProtoBase();

        // Set Methods
        
        void setTypeId(guint32 type_id) {d_type_id = type_id;};

        //! Sets the descriptive text for this Army.
        void setDescription(std::string text) {d_description = text;};
        
        //! Set the gold pieces needed to make an Army unit of this kind.
        void setProductionCost(guint32 production_cost)
	  {d_production_cost = production_cost;}

        //! Set the gold pieces needed to add this Army to a city's production.
        void setNewProductionCost(guint32 new_production_cost)
	  {d_new_production_cost = new_production_cost;}

	//! Sets the armyset id for this army.
	void setArmyset(guint32 id) {d_armyset = id;};

        //! Set the army bonus of the army prototype.
        void setArmyBonus(guint32 bonus) {d_army_bonus = bonus;};

        //! Set the move bonus.
        void setMoveBonus(guint32 bonus) {d_move_bonus = bonus;};

        //! Set the movement points of the army.
        void setMaxMoves(guint32 moves) {d_max_moves = moves;};

        //! Set the sight of the army.
        void setSight(guint32 sight) {d_sight = sight;};

        //! Set the name of the Army.
        void setName(std::string name){d_name = name;}

        //! Set how many turns this unit type needs to be produced.
        void setProduction(guint32 production){d_production = production;};


        // Get Methods
        
	//! Get the Id of the Armyset to which the Army's type belongs.
        guint32 getTypeId() const {return d_type_id;}

        //! Returns the descriptive text of this Army.
        std::string getDescription() const {return _(d_description.c_str());}

	//! Returns how much gold making one of these army units costs.
        guint32 getProductionCost() const {return d_production_cost;}

        //! Returns how much gold setting up the production costs
	/**
	 * @return The amount of gold pieces required to add this Army
	 *         into the City's suite of 4 production slots.
	 */
        guint32 getNewProductionCost() const {return d_new_production_cost;}

	//! Returns the armyset id for this army.
	guint32 getArmyset() const {return d_armyset;};

        //! Returns the name of the Army.
        std::string getName() const {return _(d_name.c_str());};

        //! Returns how many turns this Army needs to be produced.
        guint32 getProduction() const {return d_production;};

    protected:
	//! Callback method for loading this object from an opened file.
	bool saveData(XML_Helper* helper) const;

	//! The name of the Army unit.  e.g. Scouts.
        std::string d_name;

	//! The index of the Army prototype's index in it's Armyset.
        guint32 d_type_id;

	//! The description of the Army unit.
        std::string d_description;

	//! How many gold pieces needed to create an army of this kind.
	/**
	 * Every time an army unit is created of this kind, it costs the
	 * player this many gold pieces.
	 */
        guint32 d_production_cost;

        //! How many gold pieces needed to add this Army to a city's production.
	/**
	 * If d_production_cost is over zero, then the Army can be purchased.
	 * If not, then the Army unit cannot be incorporated into a 
	 * City's production at any price.
	 *
	 * This value does not change during gameplay.
	 */
        guint32 d_new_production_cost;

	//! How many turns the Army unit takes to be produced in a City.
	/**
	 * This value must be above 0.  Normal values for d_production are
	 * 1 through 4.
	 * This value does not change during gameplay.
	 */
        guint32 d_production;

	//! The armyset to which this army prototype belongs.
	guint32 d_armyset;
	
};

#endif // ARMY_PROTO_BASE_H