Freeciv21
Develop your civilization from humble roots to a global empire
layer_city_size.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 "layer.h"
9 
10 #include <QPoint>
11 
12 #include <array>
13 
14 class QPixmap;
15 
16 namespace freeciv {
17 
18 class layer_city_size : public layer {
19 public:
20  explicit layer_city_size(struct tileset *ts, const QPoint &offset);
21  virtual ~layer_city_size() = default;
22 
23  void load_sprites() override;
24 
25  std::vector<drawn_sprite>
26  fill_sprite_array(const tile *ptile, const tile_edge *pedge,
27  const tile_corner *pcorner,
28  const unit *punit) const override;
29 
30 private:
31  mutable bool m_warned = false;
32 
33  QPoint m_offset;
34  std::array<QPixmap *, NUM_TILES_DIGITS> m_units, m_tens, m_hundreds;
35 };
36 
37 } // namespace freeciv
bool m_warned
Did we warn the user?
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 city size sprites.
void load_sprites() override
Loads all sprites that do not depend on the ruleset.
layer_city_size(struct tileset *ts, const QPoint &offset)
std::array< QPixmap *, NUM_TILES_DIGITS > m_hundreds
std::array< QPixmap *, NUM_TILES_DIGITS > m_tens
std::array< QPixmap *, NUM_TILES_DIGITS > m_units
virtual ~layer_city_size()=default
A layer when drawing the map.
Definition: layer.h:153
Definition: path.cpp:10
Definition: tile.h:42
Definition: unit.h:134