Pyrogenesis  13997
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
CCmpTerritoryManager Class Reference
Inheritance diagram for CCmpTerritoryManager:
ICmpTerritoryManager IComponent

Classes

struct  SBoundaryLine
 

Public Member Functions

virtual void Init (const CParamNode &paramNode)
 
virtual void Deinit ()
 
virtual void Serialize (ISerializer &serialize)
 
virtual void Deserialize (const CParamNode &paramNode, IDeserializer &deserialize)
 
virtual void HandleMessage (const CMessage &msg, bool global)
 
void MakeDirtyIfRelevantEntity (entity_id_t ent)
 
virtual const Grid< u8 > & GetTerritoryGrid ()
 For each tile, the TERRITORY_PLAYER_MASK bits are player ID; TERRITORY_CONNECTED_MASK is set if the tile is connected to a root object (civ center etc). More...
 
virtual player_id_t GetOwner (entity_pos_t x, entity_pos_t z)
 Get owner of territory at given position. More...
 
virtual bool IsConnected (entity_pos_t x, entity_pos_t z)
 Get whether territory at given position is connected to a root object (civ center etc) owned by that territory's player. More...
 
void MakeDirty ()
 
virtual bool NeedUpdate (size_t *dirtyID)
 
void CalculateTerritories ()
 
void RasteriseInfluences (CComponentManager::InterfaceList &infls, Grid< u8 > &grid)
 Updates grid based on the obstruction shapes of all entities with a TerritoryInfluence component. More...
 
std::vector< STerritoryBoundaryComputeBoundaries ()
 
void UpdateBoundaryLines ()
 
void Interpolate (float frameTime, float frameOffset)
 
void RenderSubmit (SceneCollector &collector)
 
- Public Member Functions inherited from IComponent
virtual ~IComponent ()
 
CEntityHandle GetEntityHandle () const
 
void SetEntityHandle (CEntityHandle ent)
 
entity_id_t GetEntityId () const
 
CEntityHandle GetSystemEntity () const
 
const CSimContextGetSimContext () const
 
void SetSimContext (const CSimContext &context)
 
virtual JSClass * GetJSClass () const
 
virtual jsval GetJSInstance () const
 

Static Public Member Functions

static void ClassInit (CComponentManager &componentManager)
 
static IComponentAllocate (ScriptInterface &, jsval)
 
static void Deallocate (IComponent *cmp)
 
static std::string GetSchema ()
 
- Static Public Member Functions inherited from IComponent
static std::string GetSchema ()
 
static u8 GetSerializationVersion ()
 

Public Attributes

u8 m_ImpassableCost
 
float m_BorderThickness
 
float m_BorderSeparation
 
Grid< u8 > * m_Territories
 
bool m_TriggerEvent
 
std::vector< SBoundaryLinem_BoundaryLines
 
bool m_BoundaryLinesDirty
 
double m_AnimTime
 
TerritoryOverlaym_DebugOverlay
 
bool m_EnableLineDebugOverlays
 Enable node debugging overlays for boundary lines? More...
 
std::vector< SOverlayLinem_DebugBoundaryLineNodes
 
size_t m_DirtyID
 

Additional Inherited Members

- Static Public Attributes inherited from ICmpTerritoryManager
static const int TERRITORY_PLAYER_MASK = 0x3F
 
static const int TERRITORY_CONNECTED_MASK = 0x40
 
static const int TERRITORY_PROCESSED_MASK = 0x80
 

Detailed Description

Definition at line 62 of file CCmpTerritoryManager.cpp.

Member Function Documentation

static IComponent* CCmpTerritoryManager::Allocate ( ScriptInterface ,
jsval   
)
inlinestatic

Definition at line 76 of file CCmpTerritoryManager.cpp.

void CCmpTerritoryManager::CalculateTerritories ( )

Definition at line 332 of file CCmpTerritoryManager.cpp.

static void CCmpTerritoryManager::ClassInit ( CComponentManager componentManager)
inlinestatic

Definition at line 65 of file CCmpTerritoryManager.cpp.

std::vector< STerritoryBoundary > CCmpTerritoryManager::ComputeBoundaries ( )

Definition at line 599 of file CCmpTerritoryManager.cpp.

static void CCmpTerritoryManager::Deallocate ( IComponent cmp)
inlinestatic

Definition at line 76 of file CCmpTerritoryManager.cpp.

virtual void CCmpTerritoryManager::Deinit ( )
inlinevirtual

Implements IComponent.

Definition at line 135 of file CCmpTerritoryManager.cpp.

virtual void CCmpTerritoryManager::Deserialize ( const CParamNode paramNode,
IDeserializer deserialize 
)
inlinevirtual

Implements IComponent.

Definition at line 147 of file CCmpTerritoryManager.cpp.

player_id_t CCmpTerritoryManager::GetOwner ( entity_pos_t  x,
entity_pos_t  z 
)
virtual

Get owner of territory at given position.

Returns
player ID of owner; 0 if neutral territory

Implements ICmpTerritoryManager.

Definition at line 715 of file CCmpTerritoryManager.cpp.

static std::string CCmpTerritoryManager::GetSchema ( )
inlinestatic

Definition at line 78 of file CCmpTerritoryManager.cpp.

virtual const Grid<u8>& CCmpTerritoryManager::GetTerritoryGrid ( )
inlinevirtual

For each tile, the TERRITORY_PLAYER_MASK bits are player ID; TERRITORY_CONNECTED_MASK is set if the tile is connected to a root object (civ center etc).

Implements ICmpTerritoryManager.

Definition at line 218 of file CCmpTerritoryManager.cpp.

virtual void CCmpTerritoryManager::HandleMessage ( const CMessage msg,
bool  global 
)
inlinevirtual

Reimplemented from IComponent.

Definition at line 152 of file CCmpTerritoryManager.cpp.

virtual void CCmpTerritoryManager::Init ( const CParamNode paramNode)
inlinevirtual

Implements IComponent.

Definition at line 113 of file CCmpTerritoryManager.cpp.

void CCmpTerritoryManager::Interpolate ( float  frameTime,
float  frameOffset 
)

Definition at line 684 of file CCmpTerritoryManager.cpp.

bool CCmpTerritoryManager::IsConnected ( entity_pos_t  x,
entity_pos_t  z 
)
virtual

Get whether territory at given position is connected to a root object (civ center etc) owned by that territory's player.

Implements ICmpTerritoryManager.

Definition at line 726 of file CCmpTerritoryManager.cpp.

void CCmpTerritoryManager::MakeDirty ( )
inline

Definition at line 234 of file CCmpTerritoryManager.cpp.

void CCmpTerritoryManager::MakeDirtyIfRelevantEntity ( entity_id_t  ent)
inline

Definition at line 207 of file CCmpTerritoryManager.cpp.

virtual bool CCmpTerritoryManager::NeedUpdate ( size_t *  dirtyID)
inlinevirtual

Implements ICmpTerritoryManager.

Definition at line 242 of file CCmpTerritoryManager.cpp.

void CCmpTerritoryManager::RasteriseInfluences ( CComponentManager::InterfaceList infls,
Grid< u8 > &  grid 
)

Updates grid based on the obstruction shapes of all entities with a TerritoryInfluence component.

Grid cells are 0 if no influence, or 1+c if the influence have cost c (assumed between 0 and 254).

Definition at line 561 of file CCmpTerritoryManager.cpp.

void CCmpTerritoryManager::RenderSubmit ( SceneCollector collector)

Definition at line 705 of file CCmpTerritoryManager.cpp.

virtual void CCmpTerritoryManager::Serialize ( ISerializer serialize)
inlinevirtual

Implements IComponent.

Definition at line 141 of file CCmpTerritoryManager.cpp.

void CCmpTerritoryManager::UpdateBoundaryLines ( )

Definition at line 609 of file CCmpTerritoryManager.cpp.

Member Data Documentation

double CCmpTerritoryManager::m_AnimTime

Definition at line 106 of file CCmpTerritoryManager.cpp.

float CCmpTerritoryManager::m_BorderSeparation

Definition at line 85 of file CCmpTerritoryManager.cpp.

float CCmpTerritoryManager::m_BorderThickness

Definition at line 84 of file CCmpTerritoryManager.cpp.

std::vector<SBoundaryLine> CCmpTerritoryManager::m_BoundaryLines

Definition at line 103 of file CCmpTerritoryManager.cpp.

bool CCmpTerritoryManager::m_BoundaryLinesDirty

Definition at line 104 of file CCmpTerritoryManager.cpp.

std::vector<SOverlayLine> CCmpTerritoryManager::m_DebugBoundaryLineNodes

Definition at line 111 of file CCmpTerritoryManager.cpp.

TerritoryOverlay* CCmpTerritoryManager::m_DebugOverlay

Definition at line 108 of file CCmpTerritoryManager.cpp.

size_t CCmpTerritoryManager::m_DirtyID

Definition at line 232 of file CCmpTerritoryManager.cpp.

bool CCmpTerritoryManager::m_EnableLineDebugOverlays

Enable node debugging overlays for boundary lines?

Definition at line 110 of file CCmpTerritoryManager.cpp.

u8 CCmpTerritoryManager::m_ImpassableCost

Definition at line 83 of file CCmpTerritoryManager.cpp.

Grid<u8>* CCmpTerritoryManager::m_Territories

Definition at line 90 of file CCmpTerritoryManager.cpp.

bool CCmpTerritoryManager::m_TriggerEvent

Definition at line 94 of file CCmpTerritoryManager.cpp.


The documentation for this class was generated from the following file: