Freeciv21
Develop your civilization from humble roots to a global empire
freeciv::layer_goto Class Reference

#include <layer_goto.h>

+ Inheritance diagram for freeciv::layer_goto:
+ Collaboration diagram for freeciv::layer_goto:

Classes

struct  tile_state_sprites
 

Public Member Functions

 layer_goto (struct tileset *ts)
 
virtual ~layer_goto ()=default
 
void load_sprites () override
 Loads all sprites that do not depend on the ruleset. More...
 
std::vector< drawn_spritefill_sprite_array (const tile *ptile, const tile_edge *pedge, const tile_corner *pcorner, const unit *punit) const override
 Fill in the given sprite array with any needed goto sprites. More...
 
- Public Member Functions inherited from freeciv::layer
 layer (struct tileset *ts, mapview_layer layer)
 Constructor. More...
 
virtual ~layer ()=default
 Destructor. More...
 
virtual void initialize_player (const player *player)
 Initializes data specific to one player. More...
 
virtual void free_player (int player_id)
 Frees data initialized by initialize_player. More...
 
virtual void initialize_city_style (const citystyle &style, int index)
 Initializes data for a city style. More...
 
virtual void initialize_extra (const extra_type *extra, const QString &tag, extrastyle_id style)
 Initializes extra-specific data. More...
 
virtual void initialize_terrain (const terrain *terrain)
 Initializes terrain-specific data. More...
 
virtual void reset_ruleset ()
 Resets cached data that depends on the ruleset. More...
 
mapview_layer type () const
 

Private Attributes

bool m_warned = false
 Did we warn the user? More...
 
QPixmap * m_waypoint
 
std::array< tile_state_sprites, GTS_COUNTm_states
 

Additional Inherited Members

- Protected Member Functions inherited from freeciv::layer
struct tilesettileset () const
 
bool do_draw_unit (const tile *ptile, const unit *punit) const
 Whether a unit should be drawn. More...
 
bool solid_background (const tile *ptile, const unit *punit, const city *pcity) const
 Whether a solid background should be drawn on a tile instead of its terrain. More...
 
QPixmap * load_sprite (const QStringList &possible_names, bool required=false, bool verbose=true) const
 Shortcut to load a sprite from the tileset. More...
 

Detailed Description

Definition at line 17 of file layer_goto.h.

Constructor & Destructor Documentation

◆ layer_goto()

freeciv::layer_goto::layer_goto ( struct tileset ts)
explicit

Definition at line 13 of file layer_goto.cpp.

◆ ~layer_goto()

virtual freeciv::layer_goto::~layer_goto ( )
virtualdefault

Member Function Documentation

◆ fill_sprite_array()

std::vector< drawn_sprite > freeciv::layer_goto::fill_sprite_array ( const tile ptile,
const tile_edge pedge,
const tile_corner pcorner,
const unit punit 
) const
overridevirtual

Fill in the given sprite array with any needed goto sprites.

Reimplemented from freeciv::layer.

Definition at line 50 of file layer_goto.cpp.

◆ load_sprites()

void freeciv::layer_goto::load_sprites ( )
overridevirtual

Loads all sprites that do not depend on the ruleset.

Reimplemented from freeciv::layer.

Definition at line 17 of file layer_goto.cpp.

Member Data Documentation

◆ m_states

std::array<tile_state_sprites, GTS_COUNT> freeciv::layer_goto::m_states
private

Definition at line 38 of file layer_goto.h.

Referenced by fill_sprite_array(), and load_sprites().

◆ m_warned

bool freeciv::layer_goto::m_warned = false
mutableprivate

Did we warn the user?

Definition at line 30 of file layer_goto.h.

Referenced by fill_sprite_array().

◆ m_waypoint

QPixmap* freeciv::layer_goto::m_waypoint
private

Definition at line 31 of file layer_goto.h.

Referenced by fill_sprite_array(), and load_sprites().