initial commit, lordsawar source, slightly modified
[lordsawar] / src / port.h
1 // Copyright (C) 2007, 2008 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 #ifndef PORT_H
19 #define PORT_H
20
21 #include "Location.h"
22
23 //! A port on the game map.
24 /** 
25  * A port is place on the map that Stack objects can use to gain access to
26  * the water.
27  */
28 class Port: public Location
29 {
30     public:
31         //! The xml tag of this object in a saved-game file.
32         static std::string d_tag; 
33
34         //! Default constructor.
35         /**
36           * @param pos          The location of the port on the game map.
37           */
38         Port(Vector<int> pos);
39
40         //! Copy constructor.
41         Port(const Port&);
42
43         //! Alternative copying constructor that gives the port a new position.
44         Port(const Port&, Vector<int> pos);
45
46         //! Loading constructor.
47         /**
48          * Load the port object from the opened saved-game file.
49          * @param helper  The opened saved-game file to load the port from.
50          */
51         Port(XML_Helper* helper);
52
53         //! Destructor.
54         ~Port();
55
56         // Methods that operate on the class data but do not modify the class.
57
58         //! Save the port data to the opened saved-game file.
59         bool save(XML_Helper* helper) const;
60
61 };
62
63 #endif // PORT_H