A const-only interface for how many (movement, vision, or "jamming") points a unit needs for each hex. More...
#include <movetype.hpp>
Public Member Functions | |
virtual | ~terrain_costs ()=default |
virtual int | value (const t_translation::terrain_code &terrain) const =0 |
Returns the value associated with the given terrain. More... | |
int | cost (const t_translation::terrain_code &terrain, bool slowed=false) const |
Returns the cost associated with the given terrain. More... | |
virtual std::unique_ptr< terrain_costs > | make_standalone () const =0 |
Does a sufficiently deep copy so that the returned object's lifespan is independent of other objects' lifespan. More... | |
virtual void | write (config &cfg, const std::string &child_name="", bool merged=true) const =0 |
Writes our data to a config. More... | |
A const-only interface for how many (movement, vision, or "jamming") points a unit needs for each hex.
Functions to modify the costs are exposed by the movetype instance owning this terrain_costs, so that changes to movement will cascade to the vision, etc.
Definition at line 52 of file movetype.hpp.
|
virtualdefault |
|
inline |
Returns the cost associated with the given terrain.
Costs are doubled when slowed is true.
Definition at line 68 of file movetype.hpp.
References game_config::sounds::status::slowed, movetype::UNREACHABLE, and value().
Referenced by pathfind::find_routes(), movetype::jamming_cost(), movetype::movement_cost(), ai::default_recruitment::recruitment::update_average_local_cost(), and movetype::vision_cost().
|
pure virtual |
Does a sufficiently deep copy so that the returned object's lifespan is independent of other objects' lifespan.
Never returns nullptr.
Implemented in movetype::terrain_info.
|
pure virtual |
Returns the value associated with the given terrain.
Calculated values are cached for later queries.
Implemented in movetype::terrain_info.
Referenced by cost().
|
pure virtual |
Writes our data to a config.
Implemented in movetype::terrain_info.