2025-08-07 22:01:34 -07:00
|
|
|
/* Copyright (C) 2025 Wildfire Games.
|
2023-12-02 16:30:12 -08:00
|
|
|
* This file is part of 0 A.D.
|
2011-12-09 23:07:04 -08:00
|
|
|
*
|
2023-12-02 16:30:12 -08:00
|
|
|
* 0 A.D. is free software: you can redistribute it and/or modify
|
2011-12-09 23:07:04 -08: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-02 16:30:12 -08:00
|
|
|
* 0 A.D. is distributed in the hope that it will be useful,
|
2011-12-09 23:07:04 -08: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-02 16:30:12 -08:00
|
|
|
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
|
2011-12-09 23:07:04 -08:00
|
|
|
*/
|
|
|
|
|
|
2018-02-07 12:58:07 -08:00
|
|
|
#ifndef INCLUDED_ICMPRALLYPOINTRENDERER
|
|
|
|
|
#define INCLUDED_ICMPRALLYPOINTRENDERER
|
2011-12-09 23:07:04 -08:00
|
|
|
|
2025-08-07 22:01:34 -07:00
|
|
|
#include "lib/types.h"
|
2011-12-09 23:07:04 -08:00
|
|
|
#include "maths/FixedVector2D.h"
|
2025-08-07 22:01:34 -07:00
|
|
|
#include "simulation2/system/Component.h"
|
2011-12-09 23:07:04 -08:00
|
|
|
#include "simulation2/system/Interface.h"
|
|
|
|
|
|
2025-08-07 22:01:34 -07:00
|
|
|
#include <js/Value.h>
|
|
|
|
|
|
2011-12-09 23:07:04 -08:00
|
|
|
/**
|
|
|
|
|
* Rally Point.
|
2012-05-24 11:25:31 -07:00
|
|
|
* Holds the position of a unit's rally points, and renders them to screen.
|
2011-12-09 23:07:04 -08:00
|
|
|
*/
|
|
|
|
|
class ICmpRallyPointRenderer : public IComponent
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
/// Sets whether the rally point marker and line should be displayed.
|
|
|
|
|
virtual void SetDisplayed(bool displayed) = 0;
|
|
|
|
|
|
|
|
|
|
/// Sets the position at which the rally point marker should be displayed.
|
2012-05-24 11:25:31 -07:00
|
|
|
/// Discards all previous positions
|
2016-01-23 07:17:56 -08:00
|
|
|
virtual void SetPosition(const CFixedVector2D& position) = 0;
|
2011-12-09 23:07:04 -08:00
|
|
|
|
2014-06-04 15:07:58 -07:00
|
|
|
/// Updates the position of one given rally point marker.
|
2016-01-23 07:17:56 -08:00
|
|
|
virtual void UpdatePosition(u32 rallyPointId, const CFixedVector2D& position) = 0;
|
2014-06-04 15:07:58 -07:00
|
|
|
|
2012-05-24 11:25:31 -07:00
|
|
|
/// Add another position at which a marker should be displayed, connected
|
|
|
|
|
/// to the previous one.
|
2016-01-23 07:17:56 -08:00
|
|
|
virtual void AddPosition_wrapper(const CFixedVector2D& position) = 0;
|
2012-05-24 11:25:31 -07:00
|
|
|
|
2013-09-24 13:27:18 -07:00
|
|
|
/// Reset the positions of this rally point marker
|
|
|
|
|
virtual void Reset() = 0;
|
|
|
|
|
|
2013-10-16 10:58:12 -07:00
|
|
|
/// Returns true if at least one display rally point is set
|
2017-01-19 18:25:19 -08:00
|
|
|
virtual bool IsSet() const = 0;
|
2013-10-16 10:58:12 -07:00
|
|
|
|
2018-02-03 06:17:31 -08:00
|
|
|
/// Updates the line color
|
|
|
|
|
virtual void UpdateColor() = 0;
|
|
|
|
|
|
2011-12-09 23:07:04 -08:00
|
|
|
DECLARE_INTERFACE_TYPE(RallyPointRenderer)
|
|
|
|
|
};
|
|
|
|
|
|
2018-02-07 12:58:07 -08:00
|
|
|
#endif // INCLUDED_ICMPRALLYPOINTRENDERER
|