Implementation of ICmpAIManager.
More...
|
int | GetComponentTypeId () const override |
|
void | Init (const CParamNode ¶mNode) override |
|
void | Deinit () override |
|
void | Serialize (ISerializer &serialize) override |
|
void | Deserialize (const CParamNode ¶mNode, IDeserializer &deserialize) override |
|
void | AddPlayer (const std::wstring &id, player_id_t player, u8 difficulty, const std::wstring &behavior) override |
| 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...
|
|
void | SetRNGSeed (u32 seed) override |
|
void | TryLoadSharedComponent () override |
|
void | RunGamestateInit () override |
|
void | StartComputation () override |
| Call this at the end of a turn, to trigger AI computation which will be ready for the next turn. More...
|
|
void | PushCommands () override |
| Call this at the start of a turn, to push the computed AI commands into the command queue. More...
|
|
virtual | ~IComponent () |
|
virtual void | HandleMessage (const CMessage &msg, bool global) |
|
CEntityHandle | GetEntityHandle () const |
|
void | SetEntityHandle (CEntityHandle ent) |
|
entity_id_t | GetEntityId () const |
|
CEntityHandle | GetSystemEntity () const |
|
const CSimContext & | GetSimContext () const |
|
void | SetSimContext (const CSimContext &context) |
|
virtual bool | NewJSObject (const 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 void | ClassInit (CComponentManager &componentManager) |
|
static IComponent * | Allocate (const ScriptInterface &, JS::HandleValue) |
|
static void | Deallocate (IComponent *cmp) |
|
static std::string | GetSchema () |
|
static JS::Value | GetAIs (const ScriptInterface &scriptInterface) |
| Returns a vector of {"id":"value-for-AddPlayer", "name":"Human readable name"} objects, based on all the available AI scripts. More...
|
|
static std::string | GetSchema () |
|
static void | RegisterComponentType (CComponentManager &mgr, EInterfaceId iid, EComponentTypeId cid, AllocFunc alloc, DeallocFunc dealloc, const char *name, const std::string &schema) |
|
static void | RegisterComponentTypeScriptWrapper (CComponentManager &mgr, EInterfaceId iid, EComponentTypeId cid, AllocFunc alloc, DeallocFunc dealloc, const char *name, const std::string &schema) |
|
static u8 | GetSerializationVersion () |
|
Implementation of ICmpAIManager.
◆ AddPlayer()
void CCmpAIManager::AddPlayer |
( |
const std::wstring & |
id, |
|
|
player_id_t |
player, |
|
|
u8 |
difficulty, |
|
|
const std::wstring & |
|
|
) |
| |
|
inlineoverridevirtual |
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.
◆ Allocate()
◆ ClassInit()
◆ Deallocate()
static void CCmpAIManager::Deallocate |
( |
IComponent * |
cmp | ) |
|
|
inlinestatic |
◆ Deinit()
void CCmpAIManager::Deinit |
( |
| ) |
|
|
inlineoverridevirtual |
◆ Deserialize()
◆ GetComponentTypeId()
int CCmpAIManager::GetComponentTypeId |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ GetSchema()
static std::string CCmpAIManager::GetSchema |
( |
| ) |
|
|
inlinestatic |
◆ Init()
void CCmpAIManager::Init |
( |
const CParamNode & |
paramNode | ) |
|
|
inlineoverridevirtual |
◆ LoadPathfinderClasses()
void CCmpAIManager::LoadPathfinderClasses |
( |
JS::HandleValue |
state | ) |
|
|
inlineprivate |
◆ LoadUsedEntityTemplates()
void CCmpAIManager::LoadUsedEntityTemplates |
( |
| ) |
|
|
inlineprivate |
Load the templates of all entities on the map (called when adding a new AI player for a new game or when deserializing)
◆ PushCommands()
void CCmpAIManager::PushCommands |
( |
| ) |
|
|
inlineoverridevirtual |
Call this at the start of a turn, to push the computed AI commands into the command queue.
Implements ICmpAIManager.
◆ RunGamestateInit()
void CCmpAIManager::RunGamestateInit |
( |
| ) |
|
|
inlineoverridevirtual |
◆ Serialize()
void CCmpAIManager::Serialize |
( |
ISerializer & |
serialize | ) |
|
|
inlineoverridevirtual |
◆ SetRNGSeed()
void CCmpAIManager::SetRNGSeed |
( |
u32 |
seed | ) |
|
|
inlineoverridevirtual |
◆ StartComputation()
void CCmpAIManager::StartComputation |
( |
| ) |
|
|
inlineoverridevirtual |
Call this at the end of a turn, to trigger AI computation which will be ready for the next turn.
Implements ICmpAIManager.
◆ TryLoadSharedComponent()
void CCmpAIManager::TryLoadSharedComponent |
( |
| ) |
|
|
inlineoverridevirtual |
◆ m_JustDeserialized
bool CCmpAIManager::m_JustDeserialized |
|
private |
◆ m_TerritoriesDirtyBlinkingID
size_t CCmpAIManager::m_TerritoriesDirtyBlinkingID |
|
private |
◆ m_TerritoriesDirtyID
size_t CCmpAIManager::m_TerritoriesDirtyID |
|
private |
◆ m_Worker
The documentation for this class was generated from the following file: