Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
ICmpMinimap.h
Go to the documentation of this file.
1/* Copyright (C) 2026 Wildfire Games.
2 * This file is part of 0 A.D.
3 *
4 * 0 A.D. is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * 0 A.D. is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef INCLUDED_ICMPMINIMAP
19#define INCLUDED_ICMPMINIMAP
20
24
25#include <js/Value.h>
26#include <string>
27
28/**
29 * Per-unit minimap data.
30 */
31class ICmpMinimap : public IComponent
32{
33public:
34 /**
35 * Gets the data for rendering this entity on the minimap.
36 * If it should not be drawn, returns false; otherwise the arguments are set
37 * to the color and world position.
38 */
39 virtual bool GetRenderData(std::uint8_t& r, std::uint8_t& g, std::uint8_t& b, entity_pos_t& x,
40 entity_pos_t& z) const = 0;
41
42 /**
43 * Returns true if the entity is actively pinging based on the current time.
44 */
45 virtual bool CheckPing(double currentTime, double pingDuration) = 0;
46
47 /**
48 * Updates the entity's minimap color to match the player color.
49 */
50 virtual void UpdateColor() = 0;
51
52 /**
53 * Returns true if a minimap should have icon of this entity.
54 */
55 virtual bool HasIcon() = 0;
56
57 /**
58 * Returns a path to icon of this entity.
59 */
60 virtual std::string GetIconPath() = 0;
61
62 virtual float GetIconSize() = 0;
63
65};
66
67#endif // INCLUDED_ICMPMINIMAP
Entity coordinate types.
A simple fixed-point number class.
Definition: Fixed.h:129
Per-unit minimap data.
Definition: ICmpMinimap.h:32
virtual std::string GetIconPath()=0
Returns a path to icon of this entity.
virtual float GetIconSize()=0
virtual bool GetRenderData(std::uint8_t &r, std::uint8_t &g, std::uint8_t &b, entity_pos_t &x, entity_pos_t &z) const =0
Gets the data for rendering this entity on the minimap.
virtual void UpdateColor()=0
Updates the entity's minimap color to match the player color.
virtual bool HasIcon()=0
Returns true if a minimap should have icon of this entity.
virtual bool CheckPing(double currentTime, double pingDuration)=0
Returns true if the entity is actively pinging based on the current time.
Definition: IComponent.h:33
#define DECLARE_INTERFACE_TYPE(iname)
Definition: Interface.h:23