Add get_fake_unit method to actions
This commit is contained in:
parent
34ab8d297d
commit
652647ee15
5 changed files with 10 additions and 1 deletions
|
@ -69,6 +69,8 @@ public:
|
|||
|
||||
/** Return the unit targeted by this action. Null if unit doesn't exist. */
|
||||
virtual unit* get_unit() const = 0;
|
||||
/** @return pointer to the fake unit used only for visuals */
|
||||
virtual fake_unit_ptr get_fake_unit() = 0;
|
||||
/** Returns the index of the team that owns this action */
|
||||
size_t team_index() const { return team_index_; }
|
||||
/** Returns the number of the side that owns this action, i.e. the team index + 1. */
|
||||
|
|
|
@ -50,6 +50,8 @@ public:
|
|||
|
||||
/** Return the unit targeted by this action. Null if unit doesn't exist. */
|
||||
virtual unit* get_unit() const { return unit_; }
|
||||
/** @return pointer to the fake unit used only for visuals */
|
||||
virtual fake_unit_ptr get_fake_unit() { return fake_unit_; }
|
||||
|
||||
virtual map_location get_source_hex() const;
|
||||
virtual map_location get_dest_hex() const;
|
||||
|
@ -61,7 +63,6 @@ public:
|
|||
virtual bool calculate_new_route(const map_location& source_hex, const map_location& dest_hex);
|
||||
|
||||
virtual arrow_ptr get_arrow() { return arrow_; }
|
||||
virtual fake_unit_ptr get_fake_unit() { return fake_unit_; }
|
||||
|
||||
/** Applies temporarily the result of this action to the specified unit map. */
|
||||
virtual void apply_temp_modifier(unit_map& unit_map);
|
||||
|
|
|
@ -58,6 +58,8 @@ public:
|
|||
|
||||
/** @return pointer to a copy of the recall unit. */
|
||||
virtual unit* get_unit() const { return temp_unit_; }
|
||||
/** @return pointer to the fake unit used only for visuals */
|
||||
virtual fake_unit_ptr get_fake_unit() { return fake_unit_; }
|
||||
|
||||
map_location const get_recall_hex() const { return recall_hex_; }
|
||||
|
||||
|
|
|
@ -62,6 +62,8 @@ public:
|
|||
|
||||
/** @return pointer to a fake unit representing the one that will eventually be recruited. */
|
||||
virtual unit* get_unit() const { return temp_unit_; }
|
||||
/** @return pointer to the fake unit used only for visuals */
|
||||
virtual fake_unit_ptr get_fake_unit() { return fake_unit_; }
|
||||
|
||||
map_location const get_recruit_hex() const { return recruit_hex_; }
|
||||
|
||||
|
|
|
@ -42,6 +42,8 @@ namespace wb {
|
|||
|
||||
/** Return the unit targeted by this action. Null if unit doesn't exist. */
|
||||
virtual unit* get_unit() const { return unit_; }
|
||||
/** @return null pointer */
|
||||
virtual fake_unit_ptr get_fake_unit() { return fake_unit_ptr(); }
|
||||
/** Return the location at which this action was planned. */
|
||||
virtual map_location get_source_hex() const { return loc_; }
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue