Changeset View
Changeset View
Standalone View
Standalone View
source/simulation2/components/ICmpTerritoryManager.h
/* Copyright (C) 2017 Wildfire Games. | /* Copyright (C) 2018 Wildfire Games. | ||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
Show All 14 Lines | |||||
#include "simulation2/components/ICmpPosition.h" | #include "simulation2/components/ICmpPosition.h" | ||||
template<typename T> | template<typename T> | ||||
class Grid; | class Grid; | ||||
class ICmpTerritoryManager : public IComponent | class ICmpTerritoryManager : public IComponent | ||||
{ | { | ||||
public: | public: | ||||
virtual bool NeedUpdate(size_t* dirtyID) const = 0; | virtual bool NeedUpdate(size_t* dirtyID) = 0; | ||||
virtual bool NeedUpdate(size_t* dirtyID, size_t* dirtyBlinkingID) const = 0; | virtual bool NeedUpdate(size_t* dirtyID, size_t* dirtyBlinkingID) const = 0; | ||||
/** | /** | ||||
* Number of pathfinder navcells per territory tile. | * Number of pathfinder navcells per territory tile. | ||||
* Passability data is stored per navcell, but we probably don't need that much | * Passability data is stored per navcell, but we probably don't need that much | ||||
* resolution, and a lower resolution can make the boundary lines look prettier | * resolution, and a lower resolution can make the boundary lines look prettier | ||||
* and will take less memory, so we downsample the passability data. | * and will take less memory, so we downsample the passability data. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | public: | ||||
*/ | */ | ||||
virtual u8 GetTerritoryPercentage(player_id_t player) = 0; | virtual u8 GetTerritoryPercentage(player_id_t player) = 0; | ||||
/** | /** | ||||
* Enables or disables rendering of an territory borders. | * Enables or disables rendering of an territory borders. | ||||
*/ | */ | ||||
virtual void SetVisibility(bool visible) = 0; | virtual void SetVisibility(bool visible) = 0; | ||||
/** | |||||
* Updates the boundary and territory colors. | |||||
*/ | |||||
virtual void UpdateColors() = 0; | |||||
DECLARE_INTERFACE_TYPE(TerritoryManager) | DECLARE_INTERFACE_TYPE(TerritoryManager) | ||||
}; | }; | ||||
#endif // INCLUDED_ICMPTERRITORYMANAGER | #endif // INCLUDED_ICMPTERRITORYMANAGER |
Wildfire Games · Phabricator