![]() |
Freeciv21
Develop your civilization from humble roots to a global empire
|
Draws units on the map. More...
#include <layer_units.h>
Inheritance diagram for freeciv::layer_units:
Collaboration diagram for freeciv::layer_units:Public Member Functions | |
| layer_units (struct tileset *ts, mapview_layer layer, const QPoint &activity_offset, const QPoint &select_offset, const QPoint &unit_offset, const QPoint &unit_flag_offset) | |
| Constructor. More... | |
| virtual | ~layer_units ()=default |
| void | load_sprites () override |
| Loads all static sprites needed by this layer (activities etc). More... | |
| 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... | |
| auto | focus_unit_state_count () const |
| Returns the number of steps in the focused unit animation. More... | |
| int | focus_unit_state () const |
| Returns the current state of the focused unit animation. More... | |
| int & | focus_unit_state () |
| Returns the current state of the focused unit animation. More... | |
Public Member Functions inherited from freeciv::layer_abstract_activities | |
| void | initialize_extra (const extra_type *extra, const QString &tag, extrastyle_id style) override |
| Loads the extra activity and remove activity sprites. More... | |
| void | reset_ruleset () override |
| Resets data about extras. More... | |
| QPixmap * | activity_sprite (unit_activity id, const extra_type *extra) const |
| Returns the sprite used to represent a given activity on the map. More... | |
| layer (struct tileset *ts, mapview_layer layer) | |
| Inherited constructor. 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_terrain (const terrain *terrain) |
| Initializes terrain-specific data. More... | |
| mapview_layer | type () const |
Private Member Functions | |
| void | add_automated_sprite (std::vector< drawn_sprite > &sprs, const unit *punit, const QPoint &full_offset) const |
| Adds the sprite used to represent an automated unit on the map to sprs. More... | |
| void | add_orders_sprite (std::vector< drawn_sprite > &sprs, const unit *punit, const QPoint &full_offset) const |
| Adds the sprite used to represent unit orders to sprs. More... | |
Private Attributes | |
| int | m_focus_unit_state = 0 |
| State of the focused unit animation. More... | |
| QPixmap * | m_auto_attack |
| QPixmap * | m_auto_settler |
| QPixmap * | m_auto_explore |
| QPixmap * | m_connect |
| QPixmap * | m_loaded |
| QPixmap * | m_lowfuel |
| QPixmap * | m_patrol |
| QPixmap * | m_stack |
| QPixmap * | m_tired |
| QPixmap * | m_action_decision_want |
| std::vector< QPixmap * > | m_hp_bar |
| std::vector< QPixmap * > | m_select |
| std::array< QPixmap *, MAX_NUM_BATTLEGROUPS > | m_battlegroup = {nullptr} |
| std::array< QPixmap *, MAX_VET_LEVELS > | m_veteran_level = {nullptr} |
| QPoint | m_activity_offset |
| QPoint | m_select_offset |
| QPoint | m_unit_offset |
| QPoint | m_unit_flag_offset |
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... | |
Draws units on the map.
Definition at line 17 of file layer_units.h.
|
explicit |
Constructor.
Definition at line 25 of file layer_units.cpp.
|
virtualdefault |
|
private |
Adds the sprite used to represent an automated unit on the map to sprs.
Definition at line 211 of file layer_units.cpp.
Referenced by fill_sprite_array().
|
private |
Adds the sprite used to represent unit orders to sprs.
Definition at line 242 of file layer_units.cpp.
Referenced by fill_sprite_array().
|
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 93 of file layer_units.cpp.
|
inline |
Returns the current state of the focused unit animation.
Definition at line 49 of file layer_units.h.
|
inline |
Returns the current state of the focused unit animation.
Definition at line 44 of file layer_units.h.
Referenced by fill_sprite_array(), get_drawable_unit(), reset_focus_unit_state(), and toggle_focus_unit_state().
|
inline |
Returns the number of steps in the focused unit animation.
Definition at line 39 of file layer_units.h.
Referenced by focus_unit_in_combat(), get_drawable_unit(), get_focus_unit_toggle_timeout(), and toggle_focus_unit_state().
|
overridevirtual |
Loads all static sprites needed by this layer (activities etc).
Reimplemented from freeciv::layer_abstract_activities.
Definition at line 39 of file layer_units.cpp.
|
private |
Definition at line 62 of file layer_units.h.
Referenced by fill_sprite_array(), and load_sprites().
|
private |
Definition at line 67 of file layer_units.h.
Referenced by add_automated_sprite(), add_orders_sprite(), and fill_sprite_array().
|
private |
Definition at line 60 of file layer_units.h.
Referenced by add_automated_sprite(), and load_sprites().
|
private |
Definition at line 60 of file layer_units.h.
Referenced by add_automated_sprite(), and load_sprites().
|
private |
Definition at line 60 of file layer_units.h.
Referenced by add_automated_sprite(), and load_sprites().
|
private |
Definition at line 64 of file layer_units.h.
Referenced by fill_sprite_array(), and load_sprites().
|
private |
Definition at line 60 of file layer_units.h.
Referenced by add_orders_sprite(), and load_sprites().
|
private |
State of the focused unit animation.
Definition at line 58 of file layer_units.h.
Referenced by focus_unit_state().
|
private |
Definition at line 63 of file layer_units.h.
Referenced by fill_sprite_array(), and load_sprites().
|
private |
Definition at line 61 of file layer_units.h.
Referenced by fill_sprite_array(), and load_sprites().
|
private |
Definition at line 61 of file layer_units.h.
Referenced by fill_sprite_array(), and load_sprites().
|
private |
Definition at line 61 of file layer_units.h.
Referenced by add_orders_sprite(), and load_sprites().
|
private |
Definition at line 63 of file layer_units.h.
Referenced by fill_sprite_array(), focus_unit_state_count(), and load_sprites().
|
private |
Definition at line 67 of file layer_units.h.
Referenced by fill_sprite_array().
|
private |
Definition at line 61 of file layer_units.h.
Referenced by fill_sprite_array(), and load_sprites().
|
private |
Definition at line 61 of file layer_units.h.
Referenced by fill_sprite_array(), and load_sprites().
|
private |
Definition at line 68 of file layer_units.h.
Referenced by fill_sprite_array().
|
private |
Definition at line 67 of file layer_units.h.
Referenced by fill_sprite_array().
|
private |
Definition at line 65 of file layer_units.h.
Referenced by fill_sprite_array(), and load_sprites().