1 // Copyright (C) 2007, 2008, 2009 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 3 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
18 #ifndef SIGNPOSTLIST_H
19 #define SIGNPOSTLIST_H
21 #include <sigc++/trackable.h>
22 #include "LocationList.h"
27 //! A list of Signpost objects on the game map.
29 * The signpostlist keeps track of the signs located on the game map. It
30 * is implemented as a singleton because many classes use it for looking up
33 class Signpostlist : public LocationList<Signpost*>, public sigc::trackable
36 //! The xml tag of this object in a saved-game file.
37 static std::string d_tag;
39 // Methods that operate on the class data but do not modify the class.
41 //! Saves the signpost list to the opened saved-game file.
42 bool save(XML_Helper* helper) const;
47 //! Return the singleton instance. Create a new one if needed.
48 static Signpostlist* getInstance();
50 //! Load the singleton instance loaded from the opened saved-game file.
51 static Signpostlist* getInstance(XML_Helper* helper);
53 //! Explicitly delete the singleton instance.
54 static void deleteInstance();
57 //! Default constructor.
60 //! Loading constructor.
62 * @param helper The opened saved-game file to load the signposts from.
64 Signpostlist(XML_Helper* helper);
67 //! Callback for loading signpost objects into the list.
68 bool load(std::string tag, XML_Helper* helper);
72 //! A static pointer for the singleton instance.
73 static Signpostlist* s_instance;