37 class move_unit_spectator;
46 const team & view_team);
58 std::unique_ptr<movetype::terrain_costs>
costs;
101 const std::set<map_location>* known_units =
nullptr,
102 std::size_t * enemy_count =
nullptr, std::size_t * friend_count =
nullptr,
109 const unit &viewer,
team &view_team,
110 const std::set<map_location>* known_units =
nullptr,
111 std::size_t * enemy_count =
nullptr, std::size_t * friend_count =
nullptr,
119 team &view_team,
bool instant)
120 {
return clear_unit(view_loc, viewer, view_team,
nullptr,
nullptr,
nullptr,
nullptr, instant); }
132 bool can_delay =
false,
bool invalidate =
true,
133 bool instant =
true);
145 void invalidate_after_clear();
152 void calculate_jamming(
const team * new_team);
156 const map_location &event_non_loc, std::size_t viewer_id,
157 bool check_units, std::size_t &enemy_count, std::size_t &friend_count,
161 inline void record_sighting(
const unit & seen,
const map_location & seen_loc,
162 std::size_t sighter_id,
const map_location & sighter_loc);
182 bool clear_shroud(
int side,
bool reset_fog =
false,
bool fire_events =
true);
Class that stores the part of a unit's data that is needed for fog clearing.
A const-only interface for how many (movement, vision, or "jamming") points a unit needs for each hex...
std::vector< sight_data > sightings_
This class represents a single unit of a specific type.
A record of a sighting event.
bool clear_unit(const map_location &view_loc, const unit &viewer, team &view_team, bool instant)
Clears shroud (and fog) around the provided location for view_team as if viewer was standing there...
std::size_t underlying_id
void create_jamming_map(std::map< map_location, int > &jamming, const team &view_team)
Helper function that creates the map of enemy anti-vision that's needed when creating a pathfinding::...
clearer_info(const unit &viewer)
Constructor from a unit.
This class stores all the data for a single 'side' (in game nomenclature).
void recalculate_fog(int side)
Function that recalculates the fog of war.
Encapsulates the map of the game.
void write(config &cfg) const
Writes to a config.
bool clear_shroud(int side, bool reset_fog, bool fire_events)
Function that will clear shroud (and fog) based on current unit positions.
std::unique_ptr< movetype::terrain_costs > costs
costs is always non-null, all of the constructors initialize it
const team * view_team_
Keeps track of the team associated with jamming_.
std::map< map_location, int > jamming_
void cache_units(const team *new_team=nullptr)
Function to be called if units have moved or otherwise changed.
Class to encapsulate fog/shroud clearing and the resultant sighted events.
std::tuple< bool, bool > pump_result_t
A config object defines a single node in a WML file, with access to child nodes.
std::vector< int > get_sides_not_seeing(const unit &target)
Returns the sides that cannot currently see target.
game_events::pump_result_t actor_sighted(const unit &target, const std::vector< int > *cache)
Fires sighted events for the sides that can see target.