~ubuntu-branches/ubuntu/raring/lordsawar/raring

« back to all changes in this revision

Viewing changes to src/cityset.h

  • Committer: Bazaar Package Importer
  • Author(s): Barry deFreese, Barry deFreese, Gonéri Le Bouder
  • Date: 2008-06-17 11:15:26 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20080617111526-yjyvu9df50zmpdo0
Tags: 0.0.9-1
[ Barry deFreese ]
* New upstream release.
  + Fixes gcc-4.3 builds so drop ftbfs_gcc-4.3_fix.diff.
  + Add new build-dependency for libgnet-dev.
* Add simple man page for new lordsawar-tile-editor.
* Add desktop file for lordsawar-tile-editor.
* Remove French translation on install.

[ Gonéri Le Bouder ]
* bump Debian Policy to 3.8.0. No change needed.
* fix wording in the 0.0.8-3 entry of the Debian changelog

Show diffs side-by-side

added added

removed removed

Lines of Context:
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.
5
 
//
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.
10
 
//
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
 
2
//
 
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.
 
7
//
 
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.
 
12
//
 
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 
 
16
//  02110-1301, USA.
14
17
 
15
18
#ifndef CITYSET_H
16
19
#define CITYSET_H
22
25
 
23
26
class XML_Helper;
24
27
 
25
 
/** Cityset is basically an array of citys (terrain info objects).
26
 
  * 
27
 
  * It also contains some functions for loading and some additional items, such
28
 
  * as an info string or a name.
29
 
  *
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.
36
 
  */
37
 
 
 
28
//! A list of city graphic objects in a city theme.
 
29
/** 
 
30
 * Every scenario has a city set; it is the theme of the city graphics 
 
31
 * within the game. 
 
32
 *
 
33
 * The Cityset dictates the size of city images.
 
34
 *
 
35
 * Citysets are referred to by their subdirectory name.
 
36
 *
 
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.
 
39
 */
38
40
class Cityset : public sigc::trackable
39
41
{
40
42
    public:
41
 
        /** The constructor.
42
 
          * 
43
 
          */
 
43
        //! Default constructor.
 
44
        /**
 
45
         * Make a new Cityset object by reading it in from the cityset
 
46
         * configuration file.
 
47
         *
 
48
         * @param helper  The opened cityset configuration file to load the
 
49
         *                Cityset from.
 
50
         */
44
51
        Cityset(XML_Helper* helper);
 
52
        //! Destructor.
45
53
        ~Cityset();
46
54
 
 
55
        //! Get the directory in which the cityset configuration file resides.
47
56
        std::string getSubDir() const {return d_dir;}
 
57
 
 
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
 
60
 
 
61
        //! Returns the name of the cityset.
50
62
        std::string getName() const {return d_name;}
51
63
 
52
 
        //! Returns the info string of the cityset
 
64
        //! Returns the description of the cityset.
53
65
        std::string getInfo() const {return d_info;}
54
66
 
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;}
57
69
 
58
70
    private:
59
71
 
60
72
        // DATA
 
73
        //! The name of the cityset.
 
74
        /**
 
75
         * This equates to the cityset.d_name XML entity in the cityset
 
76
         * configuration file.
 
77
         * This name appears in the dialogs where the user is asked to 
 
78
         * select a particular Cityset.
 
79
         */
61
80
        std::string d_name;
 
81
 
 
82
        //! The description of the cityset.
 
83
        /**
 
84
         * Equates to the cityset.d_info XML entity in the cityset 
 
85
         * configuration file.
 
86
         * This value is not used.
 
87
         */
62
88
        std::string d_info;
 
89
 
 
90
        //! The size of each city image onscreen.
 
91
        /**
 
92
         * Equates to the cityset.d_tilesize XML entity in the cityset
 
93
         * configuration file.
 
94
         * It represents the size in pixels of the width and height of city
 
95
         * imagery onscreen.
 
96
         */
63
97
        Uint32 d_tileSize;
 
98
 
 
99
        //! The subdirectory of the cityset.
 
100
        /**
 
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.
 
104
         */
64
105
        std::string d_dir;
65
106
};
66
107