1
// Copyright (C) 2007, 2008 Ben Asselstine
1
3
// This program is free software; you can redistribute it and/or modify
2
4
// it under the terms of the GNU General Public License as published by
3
5
// the Free Software Foundation; either version 2 of the License, or
11
13
// You should have received a copy of the GNU General Public License
12
14
// along with this program; if not, write to the Free Software
13
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
15
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15
18
#ifndef SIGNPOSTLIST_H
16
19
#define SIGNPOSTLIST_H
18
21
#include <sigc++/trackable.h>
19
#include "ObjectList.h"
22
#include "LocationList.h"
20
23
#include "signpost.h"
22
/** The signpostlist just keeps track of the signs located on the game map. It
23
* is also implemented as a singleton since many classes use it for looking up
27
class Signpostlist : public ObjectList<Signpost>, public sigc::trackable
25
//! A list of Signpost objects on the game map.
27
* The signpostlist keeps track of the signs located on the game map. It
28
* is implemented as a singleton because many classes use it for looking up
31
class Signpostlist : public LocationList<Signpost>, public sigc::trackable
30
//! Return the singleton instance. Create a new one if needed.
34
//! Return the singleton instance. Create a new one if needed.
31
35
static Signpostlist* getInstance();
33
//! Load the singleton instance with the given savegame
37
//! Load the singleton instance loaded from the opened saved-game file.
34
38
static Signpostlist* getInstance(XML_Helper* helper);
36
//! Explicitly delete the singleton instance
40
//! Explicitly delete the singleton instance.
37
41
static void deleteInstance();
40
//! Saves the game data. See XML_Helper for details.
43
//! Saves the signpost list to the opened saved-game file.
41
44
bool save(XML_Helper* helper) const;
44
//! Default constructor
47
//! Default constructor.
47
//! Loading constructor
50
//! Loading constructor.
52
* @param helper The opened saved-game file to load the signposts from.
48
54
Signpostlist(XML_Helper* helper);
51
//! Callback for loading
57
//! Callback for loading signpost objects into the list.
52
58
bool load(std::string tag, XML_Helper* helper);
60
//! A static pointer for the singleton instance.
54
61
static Signpostlist* s_instance;