18 #include "precompiled.h"
40 return "<a:component type='system'/><empty/>";
65 for (
size_t i = 0; i < numCmds; ++i)
96 virtual void FlushTurn(
const std::vector<SimulationCommand>& commands)
100 std::vector<SimulationCommand> localCommands;
103 for (
size_t i = 0; i < localCommands.size(); ++i)
107 LOGERROR(L
"Failed to call ProcessCommand() global script function");
110 for (
size_t i = 0; i < commands.size(); ++i)
114 LOGERROR(L
"Failed to call ProcessCommand() global script function");
An entity initialisation parameter node.
#define PROFILE2_EVENT(name)
Record the named event at the current time.
virtual void FlushTurn(const std::vector< SimulationCommand > &commands)
Calls the ProcessCommand(player, cmd) global script function for each command in the local queue and ...
#define REGISTER_COMPONENT_TYPE(cname)
#define UNUSED(param)
mark a function parameter as unused and avoid the corresponding compiler warning. ...
static void ClassInit(CComponentManager &componentManager)
Serialization interface; see serialization overview.
bool CallFunctionVoid(jsval val, const char *name)
Call the named property on the given object, with void return type and 0 arguments.
virtual void PostNetworkCommand(CScriptVal cmd)
Send a command associated with the current player to the networking system.
const jsval & get() const
Returns the current value.
virtual void NumberU32_Unbounded(const char *name, uint32_t &out)
A trivial wrapper around a jsval.
void ScriptVal(const char *name, jsval value)
Serialize a jsval.
int32_t player_id_t
valid player IDs are non-negative (see ICmpOwnership)
ScriptInterface & GetScriptInterface() const
virtual void Deserialize(const CParamNode ¶mNode, IDeserializer &deserialize)
Simulation command, typically received over the network in multiplayer games.
CNetTurnManager * GetTurnManager() const
virtual void PushLocalCommand(player_id_t player, CScriptVal cmd)
Pushes a new command onto the local queue.
Command queue, for sending orders to entities.
CGame * g_Game
Globally accessible pointer to the CGame object.
#define DEFAULT_COMPONENT_ALLOCATOR(cname)
const CSimContext & GetSimContext() const
void NumberU32_Unbounded(const char *name, uint32_t value)
Serialize a number.
#define PROFILE2_ATTR
Associates a string (with printf-style formatting) with the current region or event.
virtual void ScriptVal(const char *name, jsval &out)=0
Deserialize a jsval, replacing 'out'.
virtual void Init(const CParamNode ¶mNode)
static std::string GetSchema()
Abstraction around a SpiderMonkey JSContext.
void NumberI32_Unbounded(const char *name, int32_t value)
Serialize a number.
std::vector< SimulationCommand > m_LocalQueue
virtual void PostCommand(CScriptValRooted data)=0
Called by simulation code, to add a new command to be distributed to all clients and executed soon...
virtual void Serialize(ISerializer &serialize)
JSContext * GetContext() const
Deserialization interface; see serialization overview.
virtual void NumberI32_Unbounded(const char *name, int32_t &out)