The Battle for Wesnoth  1.15.1+dev
Classes | Macros | Functions | Variables
movetype.cpp File Reference

Handle movement types. More...

#include "movetype.hpp"
#include "game_board.hpp"
#include "game_config_manager.hpp"
#include "log.hpp"
#include "map/map.hpp"
#include "terrain/translation.hpp"
#include "terrain/type_data.hpp"
#include "units/types.hpp"
Include dependency graph for movetype.cpp:

Go to the source code of this file.

Classes

struct  movetype::terrain_info::parameters
 The parameters used when calculating a terrain-based value. More...
 
class  movetype::terrain_info::data
 

Macros

#define ERR_CF   LOG_STREAM(err, log_config)
 
#define WRN_CF   LOG_STREAM(warn, log_config)
 

Functions

void swap (movetype::terrain_defense &a, movetype::terrain_defense &b)
 Swap function for the terrain_defense class. More...
 
void swap (movetype &a, movetype &b)
 Swap function for the movetype class, including its terrain_info members. More...
 

Variables

static lg::log_domain log_config ("config")
 

Detailed Description

Handle movement types.

Definition in file movetype.cpp.

Macro Definition Documentation

◆ ERR_CF

#define ERR_CF   LOG_STREAM(err, log_config)

Definition at line 31 of file movetype.cpp.

Referenced by movetype::terrain_info::data::calc_value().

◆ WRN_CF

#define WRN_CF   LOG_STREAM(warn, log_config)

Definition at line 32 of file movetype.cpp.

Referenced by movetype::terrain_info::data::calc_value().

Function Documentation

◆ swap() [1/2]

Swap function for the terrain_defense class.

This relies on all of the terrain_infos having no fallback and no cascade, an assumption which is provided by terrain_defense's constructors.

Definition at line 493 of file movetype.cpp.

References movetype::terrain_defense::max_, movetype::terrain_defense::min_, and movetype::terrain_info::swap_data().

Referenced by swap(), and movetype::terrain_info::swap_data().

◆ swap() [2/2]

void swap ( movetype a,
movetype b 
)

Swap function for the movetype class, including its terrain_info members.

This relies on the two sets of the terrain_infos having their movement, vision and jamming cascaded in the same way. This assumption is provided by movetype's constructors.

Definition at line 506 of file movetype.cpp.

References movetype::defense_, movetype::flying_, movetype::jamming_, movetype::movement_, movetype::resist_, movetype::swap, swap(), movetype::terrain_info::swap_data(), and movetype::vision_.

Variable Documentation

◆ log_config

lg::log_domain log_config("config")
static