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

« back to all changes in this revision

Viewing changes to src/tileset.h

  • 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:
48
48
class Tileset : public sigc::trackable, public std::vector<Tile*>
49
49
{
50
50
    public:
 
51
        //! The xml tag of this object in a tileset configuration file.
 
52
        static std::string d_tag; 
 
53
        static std::string d_road_smallmap_tag; 
 
54
 
 
55
        //! Return the default height and width of a tile in the tileset.
 
56
        static Uint32 getDefaultTileSize();
 
57
 
51
58
        //! Default constructor.
52
59
        /**
53
60
         * Make a new Tileset.
72
79
        std::string getSubDir() const {return d_dir;}
73
80
 
74
81
        //! Set the subdirectory of where this Tileset resides on disk.
75
 
        void setSubDir(std::string dir) {d_dir = dir;}
 
82
        void setSubDir(std::string dir);
76
83
 
77
84
        //! Returns the name of the tileset.
78
85
        std::string getName() const {return d_name;}
101
108
        //! Returns the index to the given terrain type.
102
109
        Uint32 getIndex(Tile::Type type) const;
103
110
 
104
 
        //! Load the graphics for every Tile in the Tileset.
105
 
        /**
106
 
         * Loads the images associated with every TileStyle that is associated 
107
 
         * with every Tile of this Tileset.
108
 
         *
109
 
         * @note SDL must be initialized before this method is called.
110
 
         */
111
 
        void instantiatePixmaps();
 
111
        void setLargeSelectorFilename(std::string p){d_large_selector = p;};
 
112
        void setSmallSelectorFilename(std::string p){d_small_selector = p;};
 
113
        std::string getLargeSelectorFilename() {return d_large_selector;};
 
114
        std::string getSmallSelectorFilename() {return d_small_selector;};
112
115
 
113
116
        //! Lookup tilestyle by it's id in this tileset.
114
117
        TileStyle *getTileStyle(Uint32 id) {return d_tilestyles[id];}
138
141
 
139
142
        int getFreeTileStyleId();
140
143
 
 
144
        int getLargestTileStyleId();
 
145
 
 
146
        bool validate();
 
147
 
 
148
        //! Get the colour associated with the road on the smallmap.
 
149
        SDL_Color getRoadColor() const {return d_road_color;};
 
150
        void setRoadColor(SDL_Color color) {d_road_color = color;};
141
151
    private:
142
152
        //! Callback to load Tile objects into the Tileset.
143
153
        bool loadTile(std::string, XML_Helper* helper);
177
187
         */
178
188
        std::string d_dir;
179
189
 
 
190
        std::string d_small_selector;
 
191
        std::string d_large_selector;
 
192
 
180
193
        typedef std::map<Uint32, TileStyle*> TileStyleIdMap;
181
194
        //! A map that provides a TileStyle when supplying a TileStyle id.
182
195
        TileStyleIdMap d_tilestyles;
 
196
 
 
197
        SDL_Color d_road_color;
183
198
};
184
199
 
185
200
#endif // TILESET_H