~ubuntu-branches/ubuntu/trusty/lordsawar/trusty

« back to all changes in this revision

Viewing changes to src/bridge.h

  • Committer: Bazaar Package Importer
  • Author(s): Barry deFreese
  • Date: 2008-06-17 16:07:00 UTC
  • mto: (5.1.1 lenny) (1.1.5 upstream)
  • mto: This revision was merged to the branch mainline in revision 8.
  • Revision ID: james.westby@ubuntu.com-20080617160700-6d8ofoz0qkasxlnw
ImportĀ upstreamĀ versionĀ 0.1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//  Copyright (C) 2007, 2008 Ben Asselstine
 
2
//
1
3
//  This program is free software; you can redistribute it and/or modify
2
4
//  it under the terms of the GNU General Public License as published by
3
5
//  the Free Software Foundation; either version 2 of the License, or
10
12
//
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 
 
16
//  02110-1301, USA.
14
17
 
15
18
#ifndef BRIDGE_H
16
19
#define BRIDGE_H
17
20
 
18
21
#include "Location.h"
19
22
 
20
 
/** A bridge is just a thing on the map to differentiate space
21
 
  */
22
 
 
 
23
//! A bridge on the game map.
 
24
/** 
 
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.
 
29
 */
23
30
class Bridge: public Location
24
31
{
25
32
    public:
26
 
        /** Default constructor
27
 
          * 
28
 
          * @param pos          the location of the bridge
29
 
          * @param type         the type of bridge.  0=e,1 n, 2 w, 3 s
30
 
          */
31
 
        Bridge(Vector<int> pos, std::string name = "Bridge", int type=0);
32
 
 
33
 
        //! Loading constructor. See XML_Helper
 
33
        //! Default constructor.
 
34
        /**
 
35
         * @param pos          The location of the bridge.
 
36
         * @param type         The type of bridge.  0=e,1=n, 2=w, 3=s.
 
37
         */
 
38
        Bridge(Vector<int> pos, int type = 0);
 
39
        //! Copy constructor.
 
40
        Bridge(const Bridge&);
 
41
        //! Loading constructor.
 
42
        /**
 
43
         * Load the bridge from the opened saved-game file.
 
44
         * @param helper  The opened saved-game file to load the bridge from.
 
45
         */
34
46
        Bridge(XML_Helper* helper);
35
 
        Bridge(const Bridge&);
 
47
        //! Destructor.
36
48
        ~Bridge();
37
49
 
38
 
        //! Returns the type of the bridge
 
50
        //! Returns the type of the bridge.
39
51
        int getType() {return d_type;};
40
52
 
41
 
        //! Sets the type of the bridge
 
53
        //! Sets the type of the bridge.
42
54
        void setType(int type) {d_type = type;};
43
55
 
44
 
        //! Save the bridge data.
 
56
        //! Save the bridge data to the opened saved-game file.
45
57
        bool save(XML_Helper* helper) const;
46
58
 
47
59
    protected:
 
60
        //! The type of the bridge.
 
61
        /**
 
62
         * The type of the bridge refers to it's look on the map.  It can be
 
63
         * one of the following values:
 
64
         *
 
65
         * 0 = The bridge connects to a road to the west, and another bridge
 
66
         *     to the east.
 
67
         * 1 = The bridge connects to a road to the south, and another bridge
 
68
         *     to the north.
 
69
         * 2 = The bridge connects to a road to the east, and another bridge
 
70
         *     to the west.
 
71
         * 3 = The bridge connects to a road to the north, and another bridge
 
72
         *     to the south.
 
73
         */
48
74
        int d_type;
49
75
 
50
76
};