38
38
//! The xml tag of this object in a saved-game file.
39
39
static std::string d_tag;
41
//! Return the singleton instance. Create a new one if needed.
42
static Templelist* getInstance();
44
//! Load the temple list from an opened saved-game file.
46
* @param helper The opened saved-game file to load the list of
49
* @return The list of temples.
51
static Templelist* getInstance(XML_Helper* helper);
53
//! Explicitly delete the singleton instance.
54
static void deleteInstance();
41
// Methods that operate on class data but do not modify the class.
56
43
//! Saves the temple data to an opened saved-game file.
57
44
bool save(XML_Helper* helper) const;
80
67
* and is within the prescribed number of tiles. Returns NULL
81
68
* if no temple could be found.
83
Temple* getNearestVisibleTemple(const Vector<int>& pos, int dist);
85
Temple* getNearestVisibleAndUsefulTemple(Stack *stack, double percent_can_be_blessed);
87
Temple* getNearestVisibleAndUsefulTemple(Stack *stack, double percent_can_be_blessed, int dist);
70
Temple* getNearestVisibleTemple(const Vector<int>& pos, int dist) const;
72
//! Find the nearest temple that the given stack can get blessed at.
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
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
84
Temple* getNearestVisibleAndUsefulTemple(Stack *stack, double percent_can_be_blessed) const;
86
//! Find the nearest temple that the given stack can get blessed at.
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
93
* @param dist Do not consider temples farther away than dist tiles.
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.
101
Temple* getNearestVisibleAndUsefulTemple(Stack *stack, double percent_can_be_blessed, int dist) const;
106
//! Return the singleton instance. Create a new one if needed.
107
static Templelist* getInstance();
109
//! Load the temple list from an opened saved-game file.
111
* @param helper The opened saved-game file to load the list of
114
* @return The list of temples.
116
static Templelist* getInstance(XML_Helper* helper);
118
//! Explicitly delete the singleton instance.
119
static void deleteInstance();
90
122
//! Default constructor.