Changeset View
Changeset View
Standalone View
Standalone View
source/simulation2/components/ICmpRangeManager.h
Show All 22 Lines | |||||
#include "simulation2/system/Interface.h" | #include "simulation2/system/Interface.h" | ||||
#include "simulation2/helpers/Position.h" | #include "simulation2/helpers/Position.h" | ||||
#include "simulation2/helpers/Player.h" | #include "simulation2/helpers/Player.h" | ||||
#include "graphics/Terrain.h" // for TERRAIN_TILE_SIZE | #include "graphics/Terrain.h" // for TERRAIN_TILE_SIZE | ||||
class FastSpatialSubdivision; | class FastSpatialSubdivision; | ||||
enum class LosVisibility : u8; | |||||
/** | /** | ||||
* Since GetVisibility queries are run by the range manager | * To avoid recompiling TUs (a fortiori headers) dependent on RangeManager but not CLosQuerier when CLosQuerier changes, | ||||
* other code using these must include ICmpRangeManager.h anyways, | * we define it in another file. Code using LOS will then explicitly include the LOS header which makes sense anyways. | ||||
* so define this enum here (Ideally, it'd be in its own header file, | |||||
* but adding header file does incur its own compilation time increase). | |||||
*/ | |||||
enum class LosVisibility : u8 | |||||
{ | |||||
HIDDEN = 0, | |||||
FOGGED = 1, | |||||
VISIBLE = 2 | |||||
}; | |||||
/** | |||||
* The same principle applies to CLosQuerier, but to avoid recompiling TUs (a fortiori headers) | |||||
* dependent on RangeManager but not CLosQuerier when CLosQuerier changes, | |||||
* we define it in another file. Code using LOS will then explicitly include the LOS header | |||||
* which makes sense anyways. | |||||
*/ | */ | ||||
class CLosQuerier; | class CLosQuerier; | ||||
/** | /** | ||||
* Provides efficient range-based queries of the game world, | * Provides efficient range-based queries of the game world, | ||||
* and also LOS-based effects (fog of war). | * and also LOS-based effects (fog of war). | ||||
* | * | ||||
* (These are somewhat distinct concepts but they share a lot of the implementation, | * (These are somewhat distinct concepts but they share a lot of the implementation, | ||||
▲ Show 20 Lines • Show All 274 Lines • ▼ Show 20 Lines | public: | ||||
virtual bool GetLosCircular() const = 0; | virtual bool GetLosCircular() const = 0; | ||||
/** | /** | ||||
* Sets shared LOS data for player to the given list of players. | * Sets shared LOS data for player to the given list of players. | ||||
*/ | */ | ||||
virtual void SetSharedLos(player_id_t player, const std::vector<player_id_t>& players) = 0; | virtual void SetSharedLos(player_id_t player, const std::vector<player_id_t>& players) = 0; | ||||
/** | /** | ||||
* Returns shared LOS mask for player. | |||||
*/ | |||||
virtual u32 GetSharedLosMask(player_id_t player) const = 0; | |||||
/** | |||||
* Get percent map explored statistics for specified player. | * Get percent map explored statistics for specified player. | ||||
*/ | */ | ||||
virtual u8 GetPercentMapExplored(player_id_t player) const = 0; | virtual u8 GetPercentMapExplored(player_id_t player) const = 0; | ||||
/** | /** | ||||
* Get percent map explored statistics for specified set of players. | * Get percent map explored statistics for specified set of players. | ||||
* Note: this function computes statistics from scratch and should not be called too often. | * Note: this function computes statistics from scratch and should not be called too often. | ||||
*/ | */ | ||||
Show All 12 Lines |
Wildfire Games · Phabricator