The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Static Private Attributes | List of all members
movetype::terrain_costs Class Reference

Stores a set of terrain costs (for movement, vision, or "jamming"). More...

#include <movetype.hpp>

Inheritance diagram for movetype::terrain_costs:
Inheritance graph

Public Member Functions

 terrain_costs (const terrain_costs *fallback=nullptr, const terrain_costs *cascade=nullptr)
 
 terrain_costs (const config &cfg, const terrain_costs *fallback=nullptr, const terrain_costs *cascade=nullptr)
 
 terrain_costs (const terrain_costs &that, const terrain_costs *fallback=nullptr, const terrain_costs *cascade=nullptr)
 
int cost (const t_translation::t_terrain &terrain, bool slowed=false) const
 Returns the cost associated with the given terrain. More...
 
- Public Member Functions inherited from movetype::terrain_info
 terrain_info (const parameters &params, const terrain_info *fallback=nullptr, const terrain_info *cascade=nullptr)
 Constructor. More...
 
 terrain_info (const config &cfg, const parameters &params, const terrain_info *fallback=nullptr, const terrain_info *cascade=nullptr)
 Constructor. More...
 
 terrain_info (const terrain_info &that, const terrain_info *fallback=nullptr, const terrain_info *cascade=nullptr)
 Copy constructor. More...
 
 ~terrain_info ()
 Destructor. More...
 
terrain_infooperator= (const terrain_info &that)
 Assignment operator. More...
 
void clear_cache () const
 Clears the cache of values. More...
 
bool empty () const
 Returns whether or not our data is empty. More...
 
void merge (const config &new_values, bool overwrite)
 Merges the given config over the existing values. More...
 
int value (const t_translation::t_terrain &terrain) const
 Returns the value associated with the given terrain. More...
 
void write (config &cfg, const std::string &child_name="", bool merged=true) const
 Writes our data to a config. More...
 

Static Private Attributes

static const parameters params_
 

Detailed Description

Stores a set of terrain costs (for movement, vision, or "jamming").

Definition at line 88 of file movetype.hpp.

Constructor & Destructor Documentation

movetype::terrain_costs::terrain_costs ( const terrain_costs fallback = nullptr,
const terrain_costs cascade = nullptr 
)
inlineexplicit

Definition at line 92 of file movetype.hpp.

movetype::terrain_costs::terrain_costs ( const config cfg,
const terrain_costs fallback = nullptr,
const terrain_costs cascade = nullptr 
)
inlineexplicit

Definition at line 96 of file movetype.hpp.

movetype::terrain_costs::terrain_costs ( const terrain_costs that,
const terrain_costs fallback = nullptr,
const terrain_costs cascade = nullptr 
)
inline

Definition at line 101 of file movetype.hpp.

Member Function Documentation

int movetype::terrain_costs::cost ( const t_translation::t_terrain terrain,
bool  slowed = false 
) const
inline

Member Data Documentation

const movetype::terrain_info::parameters movetype::terrain_costs::params_
staticprivate

Definition at line 90 of file movetype.hpp.


The documentation for this class was generated from the following files: