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
18
21
#include "Location.h"
20
/** A bridge is just a thing on the map to differentiate space
23
//! A bridge on the game map.
25
* A bridge is a place on the map that simultaneously acts like a Road object
26
* and a Port object. Stack objects can move more efficiently on a bridge
27
* tile, and the Stack can also use it as a jumping off point into the water.
28
* A bridge object is built on a Tile with a terrain kind of Tile::WATER.
23
30
class Bridge: public Location
26
/** Default constructor
28
* @param pos the location of the bridge
29
* @param type the type of bridge. 0=e,1 n, 2 w, 3 s
31
Bridge(Vector<int> pos, std::string name = "Bridge", int type=0);
33
//! Loading constructor. See XML_Helper
33
//! Default constructor.
35
* @param pos The location of the bridge.
36
* @param type The type of bridge. 0=e,1=n, 2=w, 3=s.
38
Bridge(Vector<int> pos, int type = 0);
40
Bridge(const Bridge&);
41
//! Loading constructor.
43
* Load the bridge from the opened saved-game file.
44
* @param helper The opened saved-game file to load the bridge from.
34
46
Bridge(XML_Helper* helper);
35
Bridge(const Bridge&);
38
//! Returns the type of the bridge
50
//! Returns the type of the bridge.
39
51
int getType() {return d_type;};
41
//! Sets the type of the bridge
53
//! Sets the type of the bridge.
42
54
void setType(int type) {d_type = type;};
44
//! Save the bridge data.
56
//! Save the bridge data to the opened saved-game file.
45
57
bool save(XML_Helper* helper) const;
60
//! The type of the bridge.
62
* The type of the bridge refers to it's look on the map. It can be
63
* one of the following values:
65
* 0 = The bridge connects to a road to the west, and another bridge
67
* 1 = The bridge connects to a road to the south, and another bridge
69
* 2 = The bridge connects to a road to the east, and another bridge
71
* 3 = The bridge connects to a road to the north, and another bridge