~ubuntu-branches/ubuntu/maverick/lordsawar/maverick

« back to all changes in this revision

Viewing changes to src/vectoredunit.h

  • Committer: Bazaar Package Importer
  • Author(s): Barry deFreese
  • Date: 2010-04-10 09:29:33 UTC
  • mfrom: (1.1.9 upstream) (5.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20100410092933-23uq4dxig30kmtcw
Tags: 0.1.8-1
* New upstream release.
* Add misc:Depends for -data package.
* Bump Standards Version to 3.8.4. (No changes needed).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
//  Copyright (C) 2007, 2008 Ben Asselstine
 
1
//  Copyright (C) 2007, 2008, 2009 Ben Asselstine
2
2
//
3
3
//  This program is free software; you can redistribute it and/or modify
4
4
//  it under the terms of the GNU General Public License as published by
70
70
        //! Destructor.
71
71
        ~VectoredUnit();
72
72
 
 
73
        // Get Methods
 
74
 
73
75
        //! Return the position of the destination for this vectored unit.
74
76
        /**
75
77
         * @return The position of a tile on the game map where the vectored
77
79
         */
78
80
        Vector<int>getDestination() const {return d_destination;};
79
81
 
 
82
        //! Return how long it will take for the vectored unit to arrive.
 
83
        /**
 
84
         * Returns the number of turns that it takes for this vectored unit
 
85
         * to show up at the destination position on the game map.
 
86
         */
 
87
        int getDuration () const { return d_duration; };
 
88
 
 
89
        //! Return a pointer to the Army prototype that is being vectored.
 
90
        /**
 
91
         * @return A pointer to an Army in an Armyset.
 
92
         */
 
93
        ArmyProdBase *getArmy() const { return d_army; };
 
94
 
 
95
 
 
96
        // Set Methods
 
97
 
80
98
        //! Set the position of the destination target for this vectored unit.
81
99
        /**
82
100
         * @param dest  The position of a tile on the game map to have the
84
102
         */
85
103
        void setDestination(Vector<int>dest) {d_destination = dest;};
86
104
 
87
 
        //! Return how long it will take for the vectored unit to arrive.
88
 
        /**
89
 
         * Returns the number of turns that it takes for this vectored unit
90
 
         * to show up at the destination position on the game map.
91
 
         */
92
 
        int getDuration () const { return d_duration; };
93
 
 
94
105
        //! Sets how long it will take for the vectored unit to arrive.
95
106
        /**
96
107
         * @param duration  The number of turns to take before showing up at
98
109
         */
99
110
        void setDuration(int duration) {d_duration = duration;};
100
111
 
101
 
        //! Return a pointer to the Army prototype that is being vectored.
102
 
        /**
103
 
         * @return A pointer to an Army in an Armyset.
104
 
         */
105
 
        ArmyProdBase *getArmy() const { return d_army; };
106
 
 
107
112
        //! Set the Army prototype that is being vectored.
108
113
        void setArmy(ArmyProdBase *army) {d_army = army;}
109
114
 
 
115
 
 
116
        // Methods that operate on class data but do not modify the class
 
117
 
110
118
        //! Saves the vectored unit data to an opened saved-game file.
111
119
        bool save(XML_Helper* helper) const;
112
120
 
 
121
        //! Called when a vectored unit arrives at the destination.
 
122
        Army *armyArrives() const;
 
123
 
 
124
 
 
125
        // Methods that operate on class data and modify the class.
 
126
 
113
127
        //! Process the vectored unit at the start of a new turn.
114
128
        /**
115
129
         * @return True when this vectored unit has shown up at the destination
117
131
         */
118
132
        bool nextTurn();
119
133
 
120
 
        //! Called when a vectored unit arrives at the destination.
121
 
        Army *armyArrives();
122
134
    private:
123
135
 
124
136
        // DATA
 
137
 
125
138
        //!  The position on the game map that this vectored unit is going to.
126
139
        Vector<int> d_destination;
127
140