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

« back to all changes in this revision

Viewing changes to src/templelist.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:
38
38
        //! The xml tag of this object in a saved-game file.
39
39
        static std::string d_tag; 
40
40
 
41
 
        //! Return the singleton instance.  Create a new one if needed.
42
 
        static Templelist* getInstance();
43
 
 
44
 
        //! Load the temple list from an opened saved-game file.
45
 
        /**
46
 
         * @param helper  The opened saved-game file to load the list of 
47
 
         *                temples from.
48
 
         *
49
 
         * @return The list of temples.
50
 
         */
51
 
        static Templelist* getInstance(XML_Helper* helper);
52
 
 
53
 
        //! Explicitly delete the singleton instance.
54
 
        static void deleteInstance();
55
 
 
 
41
        // Methods that operate on class data but do not modify the class.
 
42
        
56
43
        //! Saves the temple data to an opened saved-game file.
57
44
        bool save(XML_Helper* helper) const;
58
45
 
65
52
         *
66
53
         * @return A pointer to the nearest temple that is not obscured by fog.
67
54
         */
68
 
        Temple* getNearestVisibleTemple(const Vector<int>& pos);
 
55
        Temple* getNearestVisibleTemple(const Vector<int>& pos) const;
69
56
 
70
57
        //! Find the nearest temple that is unobscured and is not too far away.
71
58
        /**
80
67
         *         and is within the prescribed number of tiles.  Returns NULL 
81
68
         *         if no temple could be found.
82
69
         */
83
 
        Temple* getNearestVisibleTemple(const Vector<int>& pos, int dist);
84
 
 
85
 
        Temple* getNearestVisibleAndUsefulTemple(Stack *stack, double percent_can_be_blessed);
86
 
 
87
 
        Temple* getNearestVisibleAndUsefulTemple(Stack *stack, double percent_can_be_blessed, int dist);
 
70
        Temple* getNearestVisibleTemple(const Vector<int>& pos, int dist) const;
 
71
 
 
72
        //! Find the nearest temple that the given stack can get blessed at.
 
73
        /**
 
74
         * @param stack  The stack that wants to get blessed at a temple.
 
75
         * @param percent_can_be_blessed  
 
76
         *               Consider temples where the minimum percentage of army 
 
77
         *               units in the stack that have not been blessed at a
 
78
         *               temple.
 
79
         * @return A pointer to the nearest temple that is not obscured by fog
 
80
         *         and has more than the given percentage of army units that
 
81
         *         can be blessed there.  Returns NULL if no temple could be
 
82
         *         found.
 
83
         */
 
84
        Temple* getNearestVisibleAndUsefulTemple(Stack *stack, double percent_can_be_blessed) const;
 
85
 
 
86
        //! Find the nearest temple that the given stack can get blessed at.
 
87
        /**
 
88
         * @param stack  The stack that wants to get blessed at a temple.
 
89
         * @param percent_can_be_blessed  
 
90
         *               Consider temples where the minimum percentage of army 
 
91
         *               units in the stack that have not been blessed at a
 
92
         *               temple.
 
93
         * @param dist   Do not consider temples farther away than dist tiles.
 
94
         *
 
95
         * @return A pointer to the nearest temple that is not obscured by fog
 
96
         *         and has more than the given percentage of army units that
 
97
         *         can be blessed there, and is within a certain number of 
 
98
         *         tiles from the stack's position on the map.  Returns NULL if 
 
99
         *         no temple could be found.
 
100
         */
 
101
        Temple* getNearestVisibleAndUsefulTemple(Stack *stack, double percent_can_be_blessed, int dist) const;
 
102
 
 
103
 
 
104
        // Static Methods
 
105
 
 
106
        //! Return the singleton instance.  Create a new one if needed.
 
107
        static Templelist* getInstance();
 
108
 
 
109
        //! Load the temple list from an opened saved-game file.
 
110
        /**
 
111
         * @param helper  The opened saved-game file to load the list of 
 
112
         *                temples from.
 
113
         *
 
114
         * @return The list of temples.
 
115
         */
 
116
        static Templelist* getInstance(XML_Helper* helper);
 
117
 
 
118
        //! Explicitly delete the singleton instance.
 
119
        static void deleteInstance();
88
120
 
89
121
    protected:
90
122
        //! Default constructor.