1 // Copyright (C) 2008, 2009 Ben Asselstine
3 // This program is free software; you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation; either version 3 of the License, or
6 // (at your option) any later version.
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU Library General Public License for more details.
13 // You should have received a copy of the GNU General Public License
14 // along with this program; if not, write to the Free Software
15 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
27 //! A placeholder for an army production object.
29 * Slots can either be empty or point to an army production object.
35 //! The xml tag of this object in a saved-game file.
36 static std::string d_tag;
38 //! Default constructor.
42 ProdSlot(const ProdSlot&);
44 //! Loading constructor.
45 ProdSlot(XML_Helper* helper);
52 //! Assign the armyprodbase associated with this object.
53 void setArmyProdBase(ArmyProdBase *prod) {d_armyprodbase = prod;};
58 //! Return the armyprodbase associated with this object.
59 ArmyProdBase *getArmyProdBase() const {return d_armyprodbase;};
62 // Methods that operate on the class data but do not modify the class.
64 //! Save the production slot to an opened saved-game file.
65 bool save(XML_Helper *helper) const;
68 // Methods that operate ont he class data and modify the class.
70 //! Delete and remove the armyprodbase from this object.
75 //! Callback to help in loading the armyprodbase into this object.
76 bool load(std::string tag, XML_Helper *helper);
80 //! The armyprodbase object that this slot contains.
81 ArmyProdBase *d_armyprodbase;