1 // Copyright (C) 2007, 2008 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
23 //! A port on the game map.
25 * A port is place on the map that Stack objects can use to gain access to
28 class Port: public Location
31 //! The xml tag of this object in a saved-game file.
32 static std::string d_tag;
34 //! Default constructor.
36 * @param pos The location of the port on the game map.
38 Port(Vector<int> pos);
43 //! Alternative copying constructor that gives the port a new position.
44 Port(const Port&, Vector<int> pos);
46 //! Loading constructor.
48 * Load the port object from the opened saved-game file.
49 * @param helper The opened saved-game file to load the port from.
51 Port(XML_Helper* helper);
56 // Methods that operate on the class data but do not modify the class.
58 //! Save the port data to the opened saved-game file.
59 bool save(XML_Helper* helper) const;