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

« back to all changes in this revision

Viewing changes to src/Itemlist.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:
22
22
#include <map>
23
23
#include <sigc++/trackable.h>
24
24
 
25
 
#include "Item.h"
 
25
#include "ItemProto.h"
26
26
 
27
27
//! A list of Item objects.
28
28
/** 
35
35
 * you can get the item belonging to the index by the []-operator using the
36
36
 * item index as index.
37
37
 */
38
 
class Itemlist : public std::map<Uint32, Item*>, public sigc::trackable
 
38
class Itemlist : public std::map<Uint32, ItemProto*>, public sigc::trackable
39
39
{
40
40
    public:
41
41
 
 
42
        //! The xml tag of this object.
 
43
        /** 
 
44
         * @note This tag appears in the items configuration file, or in a 
 
45
         * saved-game file.
 
46
         */
 
47
        static std::string d_tag; 
 
48
 
42
49
        //! Returns the singleton instance.
43
50
        static Itemlist* getInstance();
44
51
 
55
62
        //! Save the item data.  See XML_Helper for details.
56
63
        bool save(XML_Helper* helper) const;
57
64
 
58
 
        void remove(Item *item);
 
65
        void remove(ItemProto *item);
59
66
 
60
67
    protected:
61
68
        //! Default constructor.
68
75
    private:
69
76
 
70
77
        //! Callback for loading an Item from an opened saved-game file.
71
 
        bool loadItem(std::string tag, XML_Helper* helper);
 
78
        bool loadItemProto(std::string tag, XML_Helper* helper);
72
79
 
73
80
        //! Erases an Item from the list and frees the Item too.
74
81
        void flErase(iterator it);