1
// This program is free software; you can redistribute it and/or modify
2
// it under the terms of the GNU General Public License as published by
3
// the Free Software Foundation; either version 2 of the License, or
4
// (at your option) any later version.
6
// This program is distributed in the hope that it will be useful,
7
// but WITHOUT ANY WARRANTY; without even the implied warranty of
8
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9
// GNU Library General Public License for more details.
11
// You should have received a copy of the GNU General Public License
12
// along with this program; if not, write to the Free Software
13
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1
// Copyright (C) 2008 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 2 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
25
/** Cityset is basically an array of citys (terrain info objects).
27
* It also contains some functions for loading and some additional items, such
28
* as an info string or a name.
30
* The image file for a cityset contains of the terrain images. Each terrain
31
* has a row in the image, where each column has a special meaning (See
32
* MapRenderer for details how smoothing works). Furthermore, there are citys
33
* for special cases of diagonal adjacent water images. I hope to have a
34
* documentation about map rendering and citysets ready soon after the 0.3.5
35
* release. If it already exists, see there for further info.
28
//! A list of city graphic objects in a city theme.
30
* Every scenario has a city set; it is the theme of the city graphics
33
* The Cityset dictates the size of city images.
35
* Citysets are referred to by their subdirectory name.
37
* The cityset configuration file is a same named XML file inside the
38
* cityset's directory. E.g. cityset/${Cityset::d_dir}/${Cityset::d_dir}.xml.
38
40
class Cityset : public sigc::trackable
43
//! Default constructor.
45
* Make a new Cityset object by reading it in from the cityset
48
* @param helper The opened cityset configuration file to load the
44
51
Cityset(XML_Helper* helper);
55
//! Get the directory in which the cityset configuration file resides.
47
56
std::string getSubDir() const {return d_dir;}
58
//! Set the direction where the shieldset configuration file resides.
48
59
void setSubDir(std::string dir) {d_dir = dir;}
49
//! Returns the name of the cityset
61
//! Returns the name of the cityset.
50
62
std::string getName() const {return d_name;}
52
//! Returns the info string of the cityset
64
//! Returns the description of the cityset.
53
65
std::string getInfo() const {return d_info;}
55
//! Returns the citysize of the cityset.
67
//! Returns the width and height in pixels of the city images.
56
68
Uint32 getTileSize() const {return d_tileSize;}
73
//! The name of the cityset.
75
* This equates to the cityset.d_name XML entity in the cityset
77
* This name appears in the dialogs where the user is asked to
78
* select a particular Cityset.
61
80
std::string d_name;
82
//! The description of the cityset.
84
* Equates to the cityset.d_info XML entity in the cityset
86
* This value is not used.
62
88
std::string d_info;
90
//! The size of each city image onscreen.
92
* Equates to the cityset.d_tilesize XML entity in the cityset
94
* It represents the size in pixels of the width and height of city
99
//! The subdirectory of the cityset.
101
* This is the name of the subdirectory that the Cityset files are
102
* residing in. It does not contain a path (e.g. no slashes).
103
* Cityset directories sit in the citysets/ directory.
64
105
std::string d_dir;