2022-03-07 02:22:06 +01:00
|
|
|
/* Copyright (C) 2022 Wildfire Games.
|
2023-12-03 01:30:12 +01:00
|
|
|
* This file is part of 0 A.D.
|
2010-04-23 20:36:48 +02:00
|
|
|
*
|
2023-12-03 01:30:12 +01:00
|
|
|
* 0 A.D. is free software: you can redistribute it and/or modify
|
2010-04-23 20:36:48 +02:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
2023-12-03 01:30:12 +01:00
|
|
|
* 0 A.D. is distributed in the hope that it will be useful,
|
2010-04-23 20:36:48 +02:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2023-12-03 01:30:12 +01:00
|
|
|
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
|
2010-04-23 20:36:48 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef INCLUDED_ICMPMINIMAP
|
|
|
|
#define INCLUDED_ICMPMINIMAP
|
|
|
|
|
|
|
|
#include "simulation2/system/Interface.h"
|
|
|
|
|
2010-09-23 14:13:13 +02:00
|
|
|
#include "simulation2/helpers/Position.h"
|
|
|
|
|
2022-03-07 02:22:06 +01:00
|
|
|
#include <string>
|
|
|
|
|
2010-04-23 20:36:48 +02:00
|
|
|
/**
|
|
|
|
* Per-unit minimap data.
|
|
|
|
*/
|
|
|
|
class ICmpMinimap : public IComponent
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
2018-01-07 21:23:04 +01:00
|
|
|
* Gets the data for rendering this entity on the minimap.
|
2010-04-23 20:36:48 +02:00
|
|
|
* If it should not be drawn, returns false; otherwise the arguments are set
|
2015-03-16 00:59:48 +01:00
|
|
|
* to the color and world position.
|
2010-04-23 20:36:48 +02:00
|
|
|
*/
|
2017-01-20 03:25:19 +01:00
|
|
|
virtual bool GetRenderData(u8& r, u8& g, u8& b, entity_pos_t& x, entity_pos_t& z) const = 0;
|
2010-04-23 20:36:48 +02:00
|
|
|
|
2013-10-06 06:49:38 +02:00
|
|
|
/**
|
2018-01-07 21:23:04 +01:00
|
|
|
* Returns true if the entity is actively pinging based on the current time.
|
2013-10-06 06:49:38 +02:00
|
|
|
*/
|
|
|
|
virtual bool CheckPing(double currentTime, double pingDuration) = 0;
|
|
|
|
|
2018-01-07 21:23:04 +01:00
|
|
|
/**
|
|
|
|
* Updates the entity's minimap color to match the player color.
|
|
|
|
*/
|
|
|
|
virtual void UpdateColor() = 0;
|
|
|
|
|
2022-03-07 02:22:06 +01:00
|
|
|
/**
|
|
|
|
* Returns true if a minimap should have icon of this entity.
|
|
|
|
*/
|
|
|
|
virtual bool HasIcon() = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns a path to icon of this entity.
|
|
|
|
*/
|
|
|
|
virtual std::string GetIconPath() = 0;
|
|
|
|
|
|
|
|
virtual float GetIconSize() = 0;
|
|
|
|
|
2010-04-23 20:36:48 +02:00
|
|
|
DECLARE_INTERFACE_TYPE(Minimap)
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // INCLUDED_ICMPMINIMAP
|