Sighting. More...
#include "actions/vision.hpp"
#include "actions/move.hpp"
#include "config.hpp"
#include "game_events/pump.hpp"
#include "log.hpp"
#include "map/map.hpp"
#include "map/label.hpp"
#include "map/location.hpp"
#include "pathfind/pathfind.hpp"
#include "play_controller.hpp"
#include "resources.hpp"
#include "team.hpp"
#include "units/unit.hpp"
Go to the source code of this file.
Classes | |
struct | actions::shroud_clearer::sight_data |
A record of a sighting event. More... | |
Namespaces | |
actions | |
Macros | |
#define | DBG_NG LOG_STREAM(debug, log_engine) |
#define | ERR_NG LOG_STREAM(err, log_engine) |
Functions | |
static const std::string | sighted_str ("sighted") |
static bool | can_see (const unit &viewer, const map_location &loc, const std::map< map_location, int > *jamming=nullptr) |
Determines if loc is within viewer's visual range. More... | |
std::vector< int > | actions::get_sides_not_seeing (const unit &target) |
Returns the sides that cannot currently see target. More... | |
game_events::pump_result_t | actions::actor_sighted (const unit &target, const std::vector< int > *cache) |
Fires sighted events for the sides that can see target. More... | |
void | actions::recalculate_fog (int side) |
Function that recalculates the fog of war. More... | |
bool | actions::clear_shroud (int side, bool reset_fog, bool fire_events) |
Function that will clear shroud (and fog) based on current unit positions. More... | |
Variables | |
static lg::log_domain | log_engine ("engine") |
Sighting.
Definition in file vision.cpp.
#define DBG_NG LOG_STREAM(debug, log_engine) |
Definition at line 40 of file vision.cpp.
#define ERR_NG LOG_STREAM(err, log_engine) |
Definition at line 41 of file vision.cpp.
|
static |
Determines if loc is within viewer's visual range.
This is a moderately expensive function (vision is recalculated with each call), so avoid using it heavily. If jamming is left as nullptr, the jamming map is also calculated with each invocation.
Definition at line 75 of file vision.cpp.
References pathfind::paths::dest_vect::contains(), actions::create_jamming_map(), pathfind::paths::destinations, pathfind::vision_path::edges, resources::gameboard, unit::get_location(), and unit::side().
Referenced by actions::actor_sighted().
|
static |
Referenced by actions::actor_sighted(), and actions::shroud_clearer::fire_events().
|
static |