~ubuntu-branches/ubuntu/saucy/lordsawar/saucy

« back to all changes in this revision

Viewing changes to src/armyprodbase.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Barry deFreese, Barry deFreese
  • Date: 2008-12-20 13:52:12 UTC
  • mfrom: (1.1.6 upstream) (5.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20081220135212-noeb2w3y98ebo7o9
Tags: 0.1.4-1
[ Barry deFreese ]
* New upstream release.
* Move 0.0.8-2.1 changelog entry to correct point in changelog.
* Make lordsawar-data suggest lordsawar.
* Update my e-mail address.
* Add build-depends on intltool, uuid-dev, and libboost-dev.
* Don't install locales since there are no translations currently.
* Add simple man page for new lordsawar-pbm binary.
* Drop gcc4.3 patches as they have been fixed upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
6
//
 
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.
 
11
//
 
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.
 
16
//
 
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 
 
20
//  02110-1301, USA.
 
21
 
 
22
#include <iostream>
 
23
#include <sstream>
 
24
#include <algorithm>
 
25
#include "armyprodbase.h"
 
26
#include "armyprotobase.h"
 
27
#include "xmlhelper.h"
 
28
#include "armysetlist.h"
 
29
 
 
30
std::string ArmyProdBase::d_tag = "armyprodbase";
 
31
 
 
32
//#define debug(x) {std::cerr<<__FILE__<<": "<<__LINE__<<": "<<x<<std::endl<<std::flush;}
 
33
#define debug(x)
 
34
 
 
35
ArmyProdBase::ArmyProdBase(const ArmyProdBase& a)
 
36
    :ArmyProtoBase(a)
 
37
{
 
38
}
 
39
 
 
40
ArmyProdBase::ArmyProdBase(const ArmyProto& a)
 
41
    :ArmyProtoBase(a)
 
42
{
 
43
}
 
44
 
 
45
ArmyProdBase::ArmyProdBase(XML_Helper* helper)
 
46
  :ArmyProtoBase(helper)
 
47
{
 
48
  helper->getData(d_armyset, "armyset");
 
49
  helper->getData(d_type_id, "type");
 
50
}
 
51
 
 
52
ArmyProdBase::~ArmyProdBase()
 
53
{
 
54
}
 
55
 
 
56
bool ArmyProdBase::save(XML_Helper* helper) const
 
57
{
 
58
  bool retval = true;
 
59
 
 
60
  retval &= helper->openTag(ArmyProdBase::d_tag);
 
61
 
 
62
  ArmyProtoBase::saveData(helper);
 
63
 
 
64
  retval &= helper->saveData("type", d_type_id);
 
65
  retval &= helper->saveData("armyset", d_armyset);
 
66
 
 
67
  retval &= helper->closeTag();
 
68
 
 
69
  return retval;
 
70
}