~ubuntu-branches/ubuntu/natty/lordsawar/natty

« back to all changes in this revision

Viewing changes to src/armysetlist.h

  • Committer: Bazaar Package Importer
  • Author(s): Barry deFreese
  • Date: 2010-04-10 09:29:33 UTC
  • mfrom: (1.1.9 upstream) (5.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20100410092933-23uq4dxig30kmtcw
Tags: 0.1.8-1
* New upstream release.
* Add misc:Depends for -data package.
* Bump Standards Version to 3.8.4. (No changes needed).

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
#include "armyproto.h"
31
31
#include "armyset.h"
32
32
 
 
33
class Tar_Helper;
33
34
 
34
35
//! A list of all Armyset objects available to the game.
35
36
/** 
80
81
        //! Get the unshaded planted standard picture for the given Armyset.
81
82
        PixMask* getStandardPic (guint32 id);
82
83
 
 
84
        //! Get the bag of oitems picture for the given Armyset.
 
85
        PixMask* getBagPic (guint32 id);
 
86
 
83
87
        //! Get the planted standard mask for the given Armyset.
84
88
        PixMask* getStandardMask (guint32 id);
85
89
        guint32 getTileSize(guint32 id);
118
122
          * @return the id of the armyset (0 on error)
119
123
          */
120
124
        guint32 getArmysetId(std::string armyset, guint32 tilesize);
121
 
        Armyset *getArmyset(guint32 id) {return d_armysetids[id];};
 
125
        Armyset *getArmyset(guint32 id);
122
126
 
123
127
        //! Return the Armyset object by the name of the subdir.
124
128
        /**
126
130
         *             This value does not contain any slashes, and is
127
131
         *             presumed to be found inside the army/ directory.
128
132
         */
129
 
        Armyset *getArmyset(std::string dir) { return d_armysets[dir];}
130
 
 
131
 
        //! Returns a list of all Armyset objects available to the game.
132
 
        std::vector<guint32> getArmysets() const;
 
133
        Armyset *getArmyset(std::string dir);
133
134
 
134
135
        //! Return the name of the subdirectory for a given armyset.
135
136
        /** 
145
146
 
146
147
        //! Return an unused armyset number.
147
148
        static int getNextAvailableId(int after = 0);
 
149
 
 
150
        void add(Armyset *arymset);
 
151
 
 
152
        void instantiateImages();
 
153
        void uninstantiateImages();
 
154
        
 
155
 
 
156
        Armyset *import(Tar_Helper *t, std::string f, bool &broken);
148
157
    private:
 
158
        bool addToPersonalCollection(Armyset *armyset, std::string &new_subdir, guint32 &new_id);
149
159
        //! Default Constructor.  Loads all armyset objects it can find.
150
160
        /**
151
161
         * The army/ directory is scanned for armyset directories.
155
165
        //! Destructor.
156
166
        ~Armysetlist();
157
167
 
158
 
        //! Callback for loading an armyset.  See XML_Helper for details.
159
 
        bool load(std::string tag, XML_Helper *helper);
160
 
 
161
168
        //! Loads a specific armyset.
162
169
        /**
163
170
         * Load the armyset from an armyset configuration file and add it to 
164
171
         * this list of armysets.
165
172
         *
166
173
         * @param name  The subdirectory name that the Armyset resides in.
167
 
         * @param private_collection Whether or not the armyset is one from
168
 
         * the user's personal collection.
169
174
         *
170
 
         * @return True if the Armyset could be loaded.  False otherwise.
 
175
         * @return the Armyset.  NULL otherwise.
171
176
         */
172
 
        bool loadArmyset(std::string name, bool private_collection);
 
177
        Armyset* loadArmyset(std::string name);
173
178
          
174
179
        //! Loads a bunch of armysets.
175
180
        /**
176
181
         * Load a list of armysets from the system armyset directory, or the
177
182
         * user's personal collection.
178
183
         */
179
 
        void loadArmysets(std::list<std::string> armysets, bool private_collection);
 
184
        void loadArmysets(std::list<std::string> armysets);
180
185
        
181
186
        typedef std::map<guint32, std::vector<ArmyProto*> > ArmyPrototypeMap;
182
187
        typedef std::map<guint32, std::string> NameMap;