Implements worker thread for CCmpAIManager.
More...
|
| CAIWorker () |
|
| ~CAIWorker () |
|
bool | LoadScripts (const std::wstring &moduleName) |
|
void | PostCommand (int playerid, JS::HandleValue cmd) |
|
void | ComputePath (const CFixedVector2D &pos, const CFixedVector2D &goal, pass_class_t passClass, std::vector< CFixedVector2D > &waypoints) |
|
void | SetRNGSeed (u32 seed) |
|
bool | TryLoadSharedComponent (bool hasTechs) |
|
bool | AddPlayer (const std::wstring &aiName, player_id_t player, u8 difficulty) |
|
bool | RunGamestateInit (const shared_ptr< ScriptInterface::StructuredClone > &gameState, const Grid< NavcellData > &passabilityMap, const Grid< u8 > &territoryMap, const std::map< std::string, pass_class_t > &nonPathfindingPassClassMasks, const std::map< std::string, pass_class_t > &pathfindingPassClassMasks) |
|
void | UpdateGameState (const shared_ptr< ScriptInterface::StructuredClone > &gameState) |
|
void | UpdatePathfinder (const Grid< NavcellData > &passabilityMap, bool globallyDirty, const Grid< u8 > &dirtinessGrid, bool justDeserialized, const std::map< std::string, pass_class_t > &nonPathfindingPassClassMasks, const std::map< std::string, pass_class_t > &pathfindingPassClassMasks) |
|
void | UpdateTerritoryMap (const Grid< u8 > &territoryMap) |
|
void | StartComputation () |
|
void | WaitToFinishComputation () |
|
void | GetCommands (std::vector< SCommandSets > &commands) |
|
void | RegisterTechTemplates (const shared_ptr< ScriptInterface::StructuredClone > &techTemplates) |
|
void | LoadEntityTemplates (const std::vector< std::pair< std::string, const CParamNode * > > &templates) |
|
void | Serialize (std::ostream &stream, bool isDebug) |
|
void | SerializeState (ISerializer &serializer) |
|
void | Deserialize (std::istream &stream, u32 numAis) |
|
int | getPlayerSize () |
|
void | RegisterSerializablePrototype (std::wstring name, JS::HandleValue proto) |
|
|
static void | IncludeModule (ScriptInterface::CxPrivate *pCxPrivate, const std::wstring &name) |
|
static void | PostCommand (ScriptInterface::CxPrivate *pCxPrivate, int playerid, JS::HandleValue cmd) |
|
static JS::Value | ComputePath (ScriptInterface::CxPrivate *pCxPrivate, JS::HandleValue position, JS::HandleValue goal, pass_class_t passClass) |
|
static void | ForceGC (ScriptInterface::CxPrivate *pCxPrivate) |
|
static void | ExitProgram (ScriptInterface::CxPrivate *pCxPrivate) |
|
static void | DumpImage (ScriptInterface::CxPrivate *pCxPrivate, const std::wstring &name, const std::vector< u32 > &data, u32 w, u32 h, u32 max) |
| Debug function for AI scripts to dump 2D array data (e.g. More...
|
|
|
static void | Trace (JSTracer *trc, void *data) |
|
Implements worker thread for CCmpAIManager.
CAIWorker::~CAIWorker |
( |
| ) |
|
|
inline |
bool CAIWorker::AddPlayer |
( |
const std::wstring & |
aiName, |
|
|
player_id_t |
player, |
|
|
u8 |
difficulty |
|
) |
| |
|
inline |
void CAIWorker::Deserialize |
( |
std::istream & |
stream, |
|
|
u32 |
numAis |
|
) |
| |
|
inline |
Debug function for AI scripts to dump 2D array data (e.g.
terrain tile weights).
void CAIWorker::GetCommands |
( |
std::vector< SCommandSets > & |
commands | ) |
|
|
inline |
int CAIWorker::getPlayerSize |
( |
| ) |
|
|
inline |
void CAIWorker::LoadEntityTemplates |
( |
const std::vector< std::pair< std::string, const CParamNode * > > & |
templates | ) |
|
|
inline |
void CAIWorker::LoadMetadata |
( |
const VfsPath & |
path, |
|
|
JS::MutableHandleValue |
out |
|
) |
| |
|
inlineprivate |
bool CAIWorker::LoadScripts |
( |
const std::wstring & |
moduleName | ) |
|
|
inline |
void CAIWorker::PerformComputation |
( |
| ) |
|
|
inlineprivate |
void CAIWorker::PostCommand |
( |
int |
playerid, |
|
|
JS::HandleValue |
cmd |
|
) |
| |
|
inline |
void CAIWorker::RegisterSerializablePrototype |
( |
std::wstring |
name, |
|
|
JS::HandleValue |
proto |
|
) |
| |
|
inline |
void CAIWorker::Serialize |
( |
std::ostream & |
stream, |
|
|
bool |
isDebug |
|
) |
| |
|
inline |
void CAIWorker::SerializeState |
( |
ISerializer & |
serializer | ) |
|
|
inline |
void CAIWorker::SetRNGSeed |
( |
u32 |
seed | ) |
|
|
inline |
void CAIWorker::StartComputation |
( |
| ) |
|
|
inline |
static void CAIWorker::Trace |
( |
JSTracer * |
trc, |
|
|
void * |
data |
|
) |
| |
|
inlinestaticprivate |
void CAIWorker::TraceMember |
( |
JSTracer * |
trc | ) |
|
|
inlineprivate |
bool CAIWorker::TryLoadSharedComponent |
( |
bool |
hasTechs | ) |
|
|
inline |
void CAIWorker::UpdatePathfinder |
( |
const Grid< NavcellData > & |
passabilityMap, |
|
|
bool |
globallyDirty, |
|
|
const Grid< u8 > & |
dirtinessGrid, |
|
|
bool |
justDeserialized, |
|
|
const std::map< std::string, pass_class_t > & |
nonPathfindingPassClassMasks, |
|
|
const std::map< std::string, pass_class_t > & |
pathfindingPassClassMasks |
|
) |
| |
|
inline |
void CAIWorker::UpdateTerritoryMap |
( |
const Grid< u8 > & |
territoryMap | ) |
|
|
inline |
void CAIWorker::WaitToFinishComputation |
( |
| ) |
|
|
inline |
bool CAIWorker::m_CommandsComputed |
|
private |
std::map<std::wstring, JS::Heap<JSObject*> > CAIWorker::m_DeserializablePrototypes |
|
private |
JS::PersistentRootedValue CAIWorker::m_EntityTemplates |
|
private |
bool CAIWorker::m_HasLoadedEntityTemplates |
|
private |
bool CAIWorker::m_HasSharedComponent |
|
private |
std::set<std::wstring> CAIWorker::m_LoadedModules |
|
private |
std::map<std::string, pass_class_t> CAIWorker::m_NonPathfindingPassClasses |
|
private |
JS::PersistentRootedValue CAIWorker::m_PassabilityMapVal |
|
private |
std::map<std::string, pass_class_t> CAIWorker::m_PathfindingPassClasses |
|
private |
std::map<VfsPath, JS::Heap<JS::Value> > CAIWorker::m_PlayerMetadata |
|
private |
std::vector<shared_ptr<CAIPlayer> > CAIWorker::m_Players |
|
private |
boost::rand48 CAIWorker::m_RNG |
|
private |
shared_ptr<ObjectIdCache<std::wstring> > CAIWorker::m_SerializablePrototypes |
|
private |
JS::PersistentRootedValue CAIWorker::m_SharedAIObj |
|
private |
JS::PersistentRootedValue CAIWorker::m_TechTemplates |
|
private |
Grid<u8> CAIWorker::m_TerritoryMap |
|
private |
JS::PersistentRootedValue CAIWorker::m_TerritoryMapVal |
|
private |
The documentation for this class was generated from the following file: