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 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 2 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
25
#include "armyprotobase.h"
26
#include "xmlhelper.h"
29
//#define debug(x) {std::cerr<<__FILE__<<": "<<__LINE__<<": "<<x<<std::endl<<std::flush;}
32
ArmyProtoBase::ArmyProtoBase(const ArmyProtoBase& a)
33
:ArmyBase(a), d_name(a.d_name),
34
d_type_id(a.d_type_id),
35
d_description(a.d_description), d_production_cost(a.d_production_cost),
36
d_production(a.d_production), d_armyset(a.d_armyset)
40
ArmyProtoBase::ArmyProtoBase()
41
:ArmyBase(), d_name(_("Untitled")), d_type_id(0),
42
d_description(""), d_production_cost(0), d_production(0),
47
ArmyProtoBase::ArmyProtoBase(XML_Helper* helper)
48
:ArmyBase(helper), d_name(""), d_type_id(0),
49
d_description(""), d_production_cost(0), d_production(0),
53
helper->getData(d_name, "name");
54
helper->getData(d_production_cost, "production_cost");
55
helper->getData(d_production, "production");
56
helper->getData(d_description, "description");
59
ArmyProtoBase::~ArmyProtoBase()
63
bool ArmyProtoBase::saveData(XML_Helper* helper) const
67
retval &= helper->saveData("name", d_name);
68
retval &= helper->saveData("description", d_description);
69
retval &= helper->saveData("production_cost", d_production_cost);
70
retval &= helper->saveData("production", d_production);
71
retval &= ArmyBase::saveData(helper);