Freeciv21
Develop your civilization from humble roots to a global empire
layer_goto.h
Go to the documentation of this file.
1 // SPDX-License-Identifier: GPLv3-or-later
2 // SPDX-FileCopyrightText: Freeciv authors
3 // SPDX-FileCopyrightText: Freeciv21 authors
4 // SPDX-FileCopyrightText: Louis Moureaux <m_louis30@yahoo.com>
5 
6 #pragma once
7 
8 #include "goto.h"
9 #include "layer.h"
10 
11 #include <array>
12 
13 class QPixmap;
14 
15 namespace freeciv {
16 
17 class layer_goto : public layer {
18 public:
19  explicit layer_goto(struct tileset *ts);
20  virtual ~layer_goto() = default;
21 
22  void load_sprites() override;
23 
24  std::vector<drawn_sprite>
25  fill_sprite_array(const tile *ptile, const tile_edge *pedge,
26  const tile_corner *pcorner,
27  const unit *punit) const override;
28 
29 private:
30  mutable bool m_warned = false;
31  QPixmap *m_waypoint;
32 
34  QPixmap *specific;
35  std::array<QPixmap *, NUM_TILES_DIGITS> turns, turns_tens,
37  };
38  std::array<tile_state_sprites, GTS_COUNT> m_states;
39 };
40 
41 } // namespace freeciv
void load_sprites() override
Loads all sprites that do not depend on the ruleset.
Definition: layer_goto.cpp:17
bool m_warned
Did we warn the user?
Definition: layer_goto.h:30
QPixmap * m_waypoint
Definition: layer_goto.h:31
std::vector< drawn_sprite > fill_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.
Definition: layer_goto.cpp:50
layer_goto(struct tileset *ts)
Definition: layer_goto.cpp:13
std::array< tile_state_sprites, GTS_COUNT > m_states
Definition: layer_goto.h:38
virtual ~layer_goto()=default
A layer when drawing the map.
Definition: layer.h:153
Definition: path.cpp:10
std::array< QPixmap *, NUM_TILES_DIGITS > turns_tens
Definition: layer_goto.h:35
std::array< QPixmap *, NUM_TILES_DIGITS > turns_hundreds
Definition: layer_goto.h:36
std::array< QPixmap *, NUM_TILES_DIGITS > turns
Definition: layer_goto.h:35
Definition: tile.h:42
Definition: unit.h:134