![]() |
Freeciv21
Develop your civilization from humble roots to a global empire
|
#include <layer_background.h>
Inheritance diagram for freeciv::layer_background:
Collaboration diagram for freeciv::layer_background:Public Member Functions | |
| layer_background (struct tileset *ts) | |
| virtual | ~layer_background ()=default |
| std::vector< drawn_sprite > | fill_sprite_array (const tile *ptile, const tile_edge *pedge, const tile_corner *pcorner, const unit *punit) const override |
| Returns the list of sprites drawn by this layer somewhere on the map. More... | |
| void | initialize_player (const player *player) override |
| Initializes data specific to one player. More... | |
| void | free_player (int player_id) override |
| Frees data initialized by initialize_player. More... | |
Public Member Functions inherited from freeciv::layer | |
| layer (struct tileset *ts, mapview_layer layer) | |
| Constructor. More... | |
| virtual | ~layer ()=default |
| Destructor. More... | |
| virtual void | load_sprites () |
| Loads all sprites that do not depend on the ruleset. 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 Member Functions | |
| std::unique_ptr< QPixmap > | create_player_sprite (const QColor &pcolor) const |
| Create a sprite with the given color. More... | |
Private Attributes | |
| std::array< std::unique_ptr< QPixmap >, MAX_NUM_PLAYER_SLOTS > | m_player_background |
Additional Inherited Members | |
Protected Member Functions inherited from freeciv::layer | |
| struct tileset * | tileset () 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... | |
Definition at line 25 of file layer_background.h.
|
explicit |
Definition at line 24 of file layer_background.cpp.
|
virtualdefault |
|
private |
Create a sprite with the given color.
Definition at line 82 of file layer_background.cpp.
Referenced by initialize_player().
|
overridevirtual |
Returns the list of sprites drawn by this layer somewhere on the map.
Only one of ptile, pedge, or pcorner should be non-null.
Reimplemented from freeciv::layer.
Definition at line 29 of file layer_background.cpp.
|
overridevirtual |
Frees data initialized by initialize_player.
Note that this takes the player ID and not a pointer to the player; the player may have never existed.
Reimplemented from freeciv::layer.
Definition at line 73 of file layer_background.cpp.
|
overridevirtual |
Initializes data specific to one player.
This allows to cache tiles depending on the actual players in a game.
Reimplemented from freeciv::layer.
Definition at line 58 of file layer_background.cpp.
|
private |
Definition at line 42 of file layer_background.h.
Referenced by fill_sprite_array(), free_player(), and initialize_player().