Pyrogenesis  trunk
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
CCmpAIManager Class Reference

Implementation of ICmpAIManager. More...

Inheritance diagram for CCmpAIManager:
Inheritance graph
[legend]
Collaboration diagram for CCmpAIManager:
Collaboration graph
[legend]

Public Member Functions

virtual int GetComponentTypeId () const
 
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)
 
virtual void AddPlayer (const std::wstring &id, player_id_t player, u8 difficulty)
 Add a new AI player into the world, based on the AI script identified by id (corresponding to a subdirectory in simulation/ai/), to control player player. More...
 
virtual void SetRNGSeed (u32 seed)
 
virtual void TryLoadSharedComponent ()
 
virtual void RunGamestateInit ()
 
virtual void StartComputation ()
 Call this at the end of a turn, to trigger AI computation which will be ready for the next turn. More...
 
virtual void PushCommands ()
 Call this at the start of a turn, to push the computed AI commands into the command queue. More...
 
- 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 bool NewJSObject (ScriptInterface &scriptInterface, JS::MutableHandleObject out) const
 Returns false by default, indicating that a scripted wrapper of this IComponent is not supported. More...
 
virtual JS::Value GetJSInstance () const
 

Static Public Member Functions

static void ClassInit (CComponentManager &componentManager)
 
static IComponentAllocate (ScriptInterface &, JS::HandleValue)
 
static void Deallocate (IComponent *cmp)
 
static std::string GetSchema ()
 
- Static Public Member Functions inherited from ICmpAIManager
static JS::Value GetAIs (ScriptInterface &scriptInterface)
 Returns a vector of {"id":"value-for-AddPlayer", "name":"Human readable name"} objects, based on all the available AI scripts. More...
 
- Static Public Member Functions inherited from IComponent
static std::string GetSchema ()
 
static u8 GetSerializationVersion ()
 

Private Member Functions

void StartLoadEntityTemplates ()
 
bool ContinueLoadEntityTemplates ()
 
void ForceLoadEntityTemplates ()
 
void LoadPathfinderClasses (JS::HandleValue state)
 

Private Attributes

std::vector< std::string > m_TemplateNames
 
size_t m_TemplateLoadedIdx
 
std::vector< std::pair< std::string, const CParamNode * > > m_Templates
 
size_t m_TerritoriesDirtyID
 
bool m_JustDeserialized
 
CAIWorker m_Worker
 

Detailed Description

Implementation of ICmpAIManager.

Member Function Documentation

virtual void CCmpAIManager::AddPlayer ( const std::wstring &  id,
player_id_t  player,
u8  difficulty 
)
inlinevirtual

Add a new AI player into the world, based on the AI script identified by id (corresponding to a subdirectory in simulation/ai/), to control player player.

Implements ICmpAIManager.

static IComponent* CCmpAIManager::Allocate ( ScriptInterface ,
JS::HandleValue   
)
inlinestatic
static void CCmpAIManager::ClassInit ( CComponentManager componentManager)
inlinestatic
bool CCmpAIManager::ContinueLoadEntityTemplates ( )
inlineprivate
static void CCmpAIManager::Deallocate ( IComponent cmp)
inlinestatic
virtual void CCmpAIManager::Deinit ( )
inlinevirtual

Implements IComponent.

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

Implements IComponent.

void CCmpAIManager::ForceLoadEntityTemplates ( )
inlineprivate
virtual int CCmpAIManager::GetComponentTypeId ( ) const
inlinevirtual

Implements IComponent.

static std::string CCmpAIManager::GetSchema ( )
inlinestatic
virtual void CCmpAIManager::HandleMessage ( const CMessage msg,
bool  global 
)
inlinevirtual

Reimplemented from IComponent.

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

Implements IComponent.

void CCmpAIManager::LoadPathfinderClasses ( JS::HandleValue  state)
inlineprivate
virtual void CCmpAIManager::PushCommands ( )
inlinevirtual

Call this at the start of a turn, to push the computed AI commands into the command queue.

Implements ICmpAIManager.

virtual void CCmpAIManager::RunGamestateInit ( )
inlinevirtual

Implements ICmpAIManager.

virtual void CCmpAIManager::Serialize ( ISerializer serialize)
inlinevirtual

Implements IComponent.

virtual void CCmpAIManager::SetRNGSeed ( u32  seed)
inlinevirtual

Implements ICmpAIManager.

virtual void CCmpAIManager::StartComputation ( )
inlinevirtual

Call this at the end of a turn, to trigger AI computation which will be ready for the next turn.

Implements ICmpAIManager.

void CCmpAIManager::StartLoadEntityTemplates ( )
inlineprivate
virtual void CCmpAIManager::TryLoadSharedComponent ( )
inlinevirtual

Implements ICmpAIManager.

Member Data Documentation

bool CCmpAIManager::m_JustDeserialized
private
size_t CCmpAIManager::m_TemplateLoadedIdx
private
std::vector<std::string> CCmpAIManager::m_TemplateNames
private
std::vector<std::pair<std::string, const CParamNode*> > CCmpAIManager::m_Templates
private
size_t CCmpAIManager::m_TerritoriesDirtyID
private
CAIWorker CCmpAIManager::m_Worker
private

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