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
21 #define DEFAULT_SIGNPOST "nowhere"
25 #include "Renamable.h"
27 //!A signpost is a map feature where a human player can read a message.
29 * Signposts are generally useful on a hidden map, when they can direct a
30 * player to a nearby city that is obscured from view.
32 * Players can change the contents of the signpost.
34 class Signpost: public Location, public Renamable
37 //! The xml tag of this object in a saved-game file.
38 static std::string d_tag;
40 //! Default constructor.
42 * @param pos The location of the signpost on the game map.
43 * @param name The contents of the sign.
45 Signpost(Vector<int> pos, std::string name = "nowhere");
48 Signpost(const Signpost&);
50 //! Alternative copy constructor that changes the signpost's position.
51 Signpost(const Signpost&, Vector<int> pos);
53 //! Loading constructor.
55 * @param helper The opened saved-game file to load the signpost from.
57 Signpost(XML_Helper* helper);
62 // Methods that operate on the class data but do not modify the class
64 //! Save the signpost data to an opened saved-game file.
65 bool save(XML_Helper* helper) const;