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

« back to all changes in this revision

Viewing changes to src/armyprotobase.h

  • Committer: Bazaar Package Importer
  • Author(s): Barry deFreese
  • Date: 2010-04-10 09:29:33 UTC
  • mfrom: (1.1.9 upstream) (5.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20100410092933-23uq4dxig30kmtcw
Tags: 0.1.8-1
* New upstream release.
* Add misc:Depends for -data package.
* Bump Standards Version to 3.8.4. (No changes needed).

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
        //! Loading constructor.
42
42
        ArmyProtoBase(XML_Helper* helper);
43
43
        
44
 
        //! Create an empty army prototype base.
 
44
        //! Default constructor.  Create an empty army prototype base.
45
45
        ArmyProtoBase();
46
46
 
47
47
        //! Destructor.
48
48
        ~ArmyProtoBase();
49
49
 
50
 
        // Set functions:
 
50
        // Set Methods
51
51
        
52
52
        void setTypeId(guint32 type_id) {d_type_id = type_id;};
53
53
 
54
54
        //! Sets the descriptive text for this Army.
55
55
        void setDescription(std::string text) {d_description = text;};
56
56
        
57
 
        //! Set the gold pieces needed to add this Army to a city's production.
 
57
        //! Set the gold pieces needed to make an Army unit of this kind.
58
58
        void setProductionCost(guint32 production_cost)
59
59
          {d_production_cost = production_cost;}
60
60
 
 
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;}
 
64
 
61
65
        //! Sets the armyset id for this army.
62
66
        void setArmyset(guint32 id) {d_armyset = id;};
63
67
 
64
 
        // Get functions
65
 
        
66
 
        //! Get the Id of the Armyset to which the Army's type belongs.
67
 
        guint32 getTypeId() const {return d_type_id;}
68
 
 
69
 
        //! Returns the descriptive text of this Army.
70
 
        std::string getDescription() const {return _(d_description.c_str());}
71
 
 
72
 
        //! Returns how much gold setting up the production costs
73
 
        /**
74
 
         * @return The amount of gold pieces required to add this Army
75
 
         *         into the City's suite of 4 production slots.
76
 
         */
77
 
        guint32 getProductionCost() const {return d_production_cost;}
78
 
 
79
 
        //! Returns the armyset id for this army.
80
 
        guint32 getArmyset() const {return d_armyset;};
81
 
 
82
68
        //! Set the army bonus of the army prototype.
83
69
        void setArmyBonus(guint32 bonus) {d_army_bonus = bonus;};
84
70
 
94
80
        //! Set the name of the Army.
95
81
        void setName(std::string name){d_name = name;}
96
82
 
 
83
        //! Set how many turns this unit type needs to be produced.
 
84
        void setProduction(guint32 production){d_production = production;};
 
85
 
 
86
 
 
87
        // Get Methods
 
88
        
 
89
        //! Get the Id of the Armyset to which the Army's type belongs.
 
90
        guint32 getTypeId() const {return d_type_id;}
 
91
 
 
92
        //! Returns the descriptive text of this Army.
 
93
        std::string getDescription() const {return _(d_description.c_str());}
 
94
 
 
95
        //! Returns how much gold making one of these army units costs.
 
96
        guint32 getProductionCost() const {return d_production_cost;}
 
97
 
 
98
        //! Returns how much gold setting up the production costs
 
99
        /**
 
100
         * @return The amount of gold pieces required to add this Army
 
101
         *         into the City's suite of 4 production slots.
 
102
         */
 
103
        guint32 getNewProductionCost() const {return d_new_production_cost;}
 
104
 
 
105
        //! Returns the armyset id for this army.
 
106
        guint32 getArmyset() const {return d_armyset;};
 
107
 
97
108
        //! Returns the name of the Army.
98
109
        std::string getName() const {return _(d_name.c_str());};
99
110
 
100
111
        //! Returns how many turns this Army needs to be produced.
101
112
        guint32 getProduction() const {return d_production;};
102
113
 
103
 
        //! Set how many turns this unit type needs to be produced.
104
 
        void setProduction(guint32 production){d_production = production;};
105
 
 
106
114
    protected:
 
115
        //! Callback method for loading this object from an opened file.
107
116
        bool saveData(XML_Helper* helper) const;
108
117
 
109
118
        //! The name of the Army unit.  e.g. Scouts.
115
124
        //! The description of the Army unit.
116
125
        std::string d_description;
117
126
 
 
127
        //! How many gold pieces needed to create an army of this kind.
 
128
        /**
 
129
         * Every time an army unit is created of this kind, it costs the
 
130
         * player this many gold pieces.
 
131
         */
 
132
        guint32 d_production_cost;
 
133
 
118
134
        //! How many gold pieces needed to add this Army to a city's production.
119
135
        /**
120
136
         * If d_production_cost is over zero, then the Army can be purchased.
123
139
         *
124
140
         * This value does not change during gameplay.
125
141
         */
126
 
        guint32 d_production_cost;
 
142
        guint32 d_new_production_cost;
127
143
 
128
144
        //! How many turns the Army unit takes to be produced in a City.
129
145
        /**