1 // Copyright (C) 2007, 2008, 2009, 2014 Ben Asselstine 2 // 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. 7 // 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. 12 // 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 16 // 02110-1301, USA. 17 18 #pragma once 19 #ifndef SIGNPOST_H 20 #define SIGNPOST_H 21 22 #define DEFAULT_SIGNPOST "nowhere" 23 24 #include "Location.h" 25 #include "Renamable.h" 26 27 //!A signpost is a map feature where a human player can read a message. 28 /** 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. 31 * 32 * Players can change the contents of the signpost. 33 */ 34 class Signpost: public Location, public Renamable 35 { 36 public: 37 //! The xml tag of this object in a saved-game file. 38 static Glib::ustring d_tag; 39 40 //! Default constructor. 41 /** 42 * @param pos The location of the signpost on the game map. 43 * @param name The contents of the sign. 44 */ 45 Signpost(Vector<int> pos, Glib::ustring name = "nowhere"); 46 47 //! Copy constructor. 48 Signpost(const Signpost&); 49 50 //! Alternative copy constructor that changes the signpost's position. 51 Signpost(const Signpost&, Vector<int> pos); 52 53 //! Loading constructor. 54 /** 55 * @param helper The opened saved-game file to load the signpost from. 56 */ 57 Signpost(XML_Helper* helper); 58 59 //! Destructor. ~Signpost()60 ~Signpost() {}; 61 62 // Methods that operate on the class data but do not modify the class 63 64 //! Save the signpost data to an opened saved-game file. 65 bool save(XML_Helper* helper) const; 66 67 }; 68 69 #endif // SIGNPOST_H 70