Pyrogenesis  13997
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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:
ICmpAIManager IComponent

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)
 
virtual void AddPlayer (std::wstring id, player_id_t player, uint8_t 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 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 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 ICmpAIManager
static std::vector
< CScriptValRooted
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 (CScriptVal 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
 
CAIWorker m_Worker
 

Detailed Description

Implementation of ICmpAIManager.

Definition at line 895 of file CCmpAIManager.cpp.

Member Function Documentation

virtual void CCmpAIManager::AddPlayer ( std::wstring  id,
player_id_t  player,
uint8_t  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.

Definition at line 963 of file CCmpAIManager.cpp.

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

Definition at line 903 of file CCmpAIManager.cpp.

static void CCmpAIManager::ClassInit ( CComponentManager componentManager)
inlinestatic

Definition at line 898 of file CCmpAIManager.cpp.

bool CCmpAIManager::ContinueLoadEntityTemplates ( )
inlineprivate

Definition at line 1100 of file CCmpAIManager.cpp.

static void CCmpAIManager::Deallocate ( IComponent cmp)
inlinestatic

Definition at line 903 of file CCmpAIManager.cpp.

virtual void CCmpAIManager::Deinit ( )
inlinevirtual

Implements IComponent.

Definition at line 917 of file CCmpAIManager.cpp.

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

Implements IComponent.

Definition at line 931 of file CCmpAIManager.cpp.

void CCmpAIManager::ForceLoadEntityTemplates ( )
inlineprivate

Definition at line 1121 of file CCmpAIManager.cpp.

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

Definition at line 905 of file CCmpAIManager.cpp.

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

Reimplemented from IComponent.

Definition at line 940 of file CCmpAIManager.cpp.

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

Implements IComponent.

Definition at line 910 of file CCmpAIManager.cpp.

void CCmpAIManager::LoadPathfinderClasses ( CScriptVal  state)
inlineprivate

Definition at line 1128 of file CCmpAIManager.cpp.

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.

Definition at line 1062 of file CCmpAIManager.cpp.

virtual void CCmpAIManager::RunGamestateInit ( )
inlinevirtual

Implements ICmpAIManager.

Definition at line 989 of file CCmpAIManager.cpp.

virtual void CCmpAIManager::Serialize ( ISerializer serialize)
inlinevirtual

Implements IComponent.

Definition at line 921 of file CCmpAIManager.cpp.

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.

Definition at line 1021 of file CCmpAIManager.cpp.

void CCmpAIManager::StartLoadEntityTemplates ( )
inlineprivate

Definition at line 1089 of file CCmpAIManager.cpp.

virtual void CCmpAIManager::TryLoadSharedComponent ( )
inlinevirtual

Implements ICmpAIManager.

Definition at line 975 of file CCmpAIManager.cpp.

Member Data Documentation

size_t CCmpAIManager::m_TemplateLoadedIdx
private

Definition at line 1085 of file CCmpAIManager.cpp.

std::vector<std::string> CCmpAIManager::m_TemplateNames
private

Definition at line 1084 of file CCmpAIManager.cpp.

std::vector<std::pair<std::string, const CParamNode*> > CCmpAIManager::m_Templates
private

Definition at line 1086 of file CCmpAIManager.cpp.

size_t CCmpAIManager::m_TerritoriesDirtyID
private

Definition at line 1087 of file CCmpAIManager.cpp.

CAIWorker CCmpAIManager::m_Worker
private

Definition at line 1146 of file CCmpAIManager.cpp.


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