The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | List of all members
display_context Class Referenceabstract

#include <display_context.hpp>

Inheritance diagram for display_context:
Inheritance graph

Public Member Functions

virtual const std::vector< team > & teams () const =0
 
virtual const gamemapmap () const =0
 
virtual const unit_mapunits () const =0
 
virtual const std::vector
< std::string > & 
hidden_label_categories () const =0
 
std::vector< std::string > & hidden_label_categories_ref ()
 
bool would_be_discovered (const map_location &loc, int side_num, bool see_all=true)
 Given a location and a side number, indicates whether an invisible unit of that side at that location would be revealed (perhaps ambushed), based on what team side_num can see. More...
 
const unitget_visible_unit (const map_location &loc, const team &current_team, bool see_all=false) const
 
bool unit_can_move (const unit &u) const
 Will return true iff the unit u has any possible moves it can do (including attacking etc). More...
 
int village_owner (const map_location &loc) const
 Given the location of a village, will return the 0-based index of the team that currently owns it, and -1 if it is unowned. More...
 
int side_units (int side_num) const
 Returns the number of units of the side side_num. More...
 
int side_units_cost (int side_num) const
 Returns the total cost of units of side side_num. More...
 
int side_upkeep (int side_num) const
 
team_data calculate_team_data (const class team &tm, int side) const
 
bool is_observer () const
 Check if we are an observer in this game. More...
 
virtual ~display_context ()
 

Detailed Description

Definition at line 52 of file display_context.hpp.

Constructor & Destructor Documentation

virtual display_context::~display_context ( )
inlinevirtual

Definition at line 104 of file display_context.hpp.

Member Function Documentation

team_data display_context::calculate_team_data ( const class team tm,
int  side 
) const
const unit * display_context::get_visible_unit ( const map_location loc,
const team current_team,
bool  see_all = false 
) const
virtual const std::vector<std::string>& display_context::hidden_label_categories ( ) const
pure virtual
std::vector< std::string > & display_context::hidden_label_categories_ref ( )

Definition at line 23 of file display_context.cpp.

References hidden_label_categories().

Referenced by gui2::tlabel_settings::execute(), and game_state::init().

bool display_context::is_observer ( ) const

Check if we are an observer in this game.

Determine if we are an observer, by checking if every team is not locally controlled.

Definition at line 118 of file display_context.cpp.

References teams().

Referenced by display_chat_manager::add_chat_message(), events::menu_handler::clear_labels(), play_controller::is_observer(), events::menu_handler::send_chat_message(), and terrain_label::viewable().

virtual const gamemap& display_context::map ( ) const
pure virtual
int display_context::side_units ( int  side_num) const

Returns the number of units of the side side_num.

Static info getters previously declared at global scope in unit.?pp.

Definition at line 130 of file display_context.cpp.

References units().

Referenced by calculate_team_data(), and ai_testing::log_turn().

int display_context::side_units_cost ( int  side_num) const

Returns the total cost of units of side side_num.

Definition at line 139 of file display_context.cpp.

References units().

Referenced by ai_testing::log_turn().

int display_context::side_upkeep ( int  side_num) const
virtual const std::vector<team>& display_context::teams ( ) const
pure virtual
bool display_context::unit_can_move ( const unit u) const
virtual const unit_map& display_context::units ( ) const
pure virtual
int display_context::village_owner ( const map_location loc) const
bool display_context::would_be_discovered ( const map_location loc,
int  side_num,
bool  see_all = true 
)

Given a location and a side number, indicates whether an invisible unit of that side at that location would be revealed (perhaps ambushed), based on what team side_num can see.

If see_all is true then the calculation ignores fog, and enemy ambushers.

Definition at line 27 of file display_context.cpp.

References unit_map::find(), get_adjacent_tiles(), unit::incapacitated(), unit::invisible(), unit::side(), teams(), units(), and unit_map::iterator_base< iter_types >::valid().

Referenced by unit::invisible().


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