Pyrogenesis  13997
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | List of all members
CAIWorker::CAIPlayer Class Reference

Public Member Functions

 CAIPlayer (CAIWorker &worker, const std::wstring &aiName, player_id_t player, uint8_t difficulty, const shared_ptr< ScriptRuntime > &runtime, boost::rand48 &rng)
 
 ~CAIPlayer ()
 
bool LoadScripts (const std::wstring &moduleName)
 
bool Initialise (bool callConstructor)
 
void Run (CScriptVal state)
 
void Run (CScriptVal state, CScriptValRooted SharedAI)
 
void InitWithSharedScript (CScriptVal state, CScriptValRooted SharedAI)
 

Static Public Member Functions

static void IncludeModule (void *cbdata, std::wstring name)
 
static void DumpHeap (void *cbdata)
 
static void ForceGC (void *cbdata)
 
static void PostCommand (void *cbdata, CScriptValRooted cmd)
 
static void DumpImage (void *cbdata, std::wstring name, 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 RegisterSerializablePrototype (void *cbdata, std::wstring name, CScriptVal proto)
 

Public Attributes

CAIWorkerm_Worker
 
std::wstring m_AIName
 
player_id_t m_Player
 
uint8_t m_Difficulty
 
bool m_UseSharedComponent
 
ScriptInterface m_ScriptInterface
 
CScriptValRooted m_Obj
 
std::vector< shared_ptr
< ScriptInterface::StructuredClone > > 
m_Commands
 
std::set< std::wstring > m_LoadedModules
 

Private Member Functions

 NONCOPYABLE (CAIPlayer)
 

Detailed Description

Definition at line 76 of file CCmpAIManager.cpp.

Constructor & Destructor Documentation

CAIWorker::CAIPlayer::CAIPlayer ( CAIWorker worker,
const std::wstring &  aiName,
player_id_t  player,
uint8_t  difficulty,
const shared_ptr< ScriptRuntime > &  runtime,
boost::rand48 &  rng 
)
inline

Definition at line 80 of file CCmpAIManager.cpp.

CAIWorker::CAIPlayer::~CAIPlayer ( )
inline

Definition at line 99 of file CCmpAIManager.cpp.

Member Function Documentation

static void CAIWorker::CAIPlayer::DumpHeap ( void *  cbdata)
inlinestatic

Definition at line 112 of file CCmpAIManager.cpp.

static void CAIWorker::CAIPlayer::DumpImage ( void *  cbdata,
std::wstring  name,
std::vector< u32 data,
u32  w,
u32  h,
u32  max 
)
inlinestatic

Debug function for AI scripts to dump 2D array data (e.g.

terrain tile weights). TODO: check if this needs to be here too.

Definition at line 136 of file CCmpAIManager.cpp.

static void CAIWorker::CAIPlayer::ForceGC ( void *  cbdata)
inlinestatic

Definition at line 119 of file CCmpAIManager.cpp.

static void CAIWorker::CAIPlayer::IncludeModule ( void *  cbdata,
std::wstring  name 
)
inlinestatic

Definition at line 106 of file CCmpAIManager.cpp.

bool CAIWorker::CAIPlayer::Initialise ( bool  callConstructor)
inline

Definition at line 209 of file CCmpAIManager.cpp.

void CAIWorker::CAIPlayer::InitWithSharedScript ( CScriptVal  state,
CScriptValRooted  SharedAI 
)
inline

Definition at line 285 of file CCmpAIManager.cpp.

bool CAIWorker::CAIPlayer::LoadScripts ( const std::wstring &  moduleName)
inline

Definition at line 185 of file CCmpAIManager.cpp.

CAIWorker::CAIPlayer::NONCOPYABLE ( CAIPlayer  )
private
static void CAIWorker::CAIPlayer::PostCommand ( void *  cbdata,
CScriptValRooted  cmd 
)
inlinestatic

Definition at line 125 of file CCmpAIManager.cpp.

static void CAIWorker::CAIPlayer::RegisterSerializablePrototype ( void *  cbdata,
std::wstring  name,
CScriptVal  proto 
)
inlinestatic

Definition at line 173 of file CCmpAIManager.cpp.

void CAIWorker::CAIPlayer::Run ( CScriptVal  state)
inline

Definition at line 273 of file CCmpAIManager.cpp.

void CAIWorker::CAIPlayer::Run ( CScriptVal  state,
CScriptValRooted  SharedAI 
)
inline

Definition at line 280 of file CCmpAIManager.cpp.

Member Data Documentation

std::wstring CAIWorker::CAIPlayer::m_AIName

Definition at line 292 of file CCmpAIManager.cpp.

std::vector<shared_ptr<ScriptInterface::StructuredClone> > CAIWorker::CAIPlayer::m_Commands

Definition at line 299 of file CCmpAIManager.cpp.

uint8_t CAIWorker::CAIPlayer::m_Difficulty

Definition at line 294 of file CCmpAIManager.cpp.

std::set<std::wstring> CAIWorker::CAIPlayer::m_LoadedModules

Definition at line 300 of file CCmpAIManager.cpp.

CScriptValRooted CAIWorker::CAIPlayer::m_Obj

Definition at line 298 of file CCmpAIManager.cpp.

player_id_t CAIWorker::CAIPlayer::m_Player

Definition at line 293 of file CCmpAIManager.cpp.

ScriptInterface CAIWorker::CAIPlayer::m_ScriptInterface

Definition at line 297 of file CCmpAIManager.cpp.

bool CAIWorker::CAIPlayer::m_UseSharedComponent

Definition at line 295 of file CCmpAIManager.cpp.

CAIWorker& CAIWorker::CAIPlayer::m_Worker

Definition at line 291 of file CCmpAIManager.cpp.


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