C:/quickbuild-1.2.13/working/root/Docs/TGEA_Offline_Docs/checkouts/engine/source/console/sim.h File Reference

#include "platform/types.h"

Namespaces

namespace  Sim

Defines

#define DeclareNamedSet(set)   extern SimSet *g##set;inline SimSet *get##set() { return g##set; }
#define DeclareNamedGroup(set)   extern SimGroup *g##set;inline SimGroup *get##set() { return g##set; }
#define ImplementNamedSet(set)   SimSet *g##set;
#define ImplementNamedGroup(set)   SimGroup *g##set;
#define DECLARE_CONSOLETYPE(T)   DefineConsoleType( Type##T##Ptr, T * )
#define IMPLEMENT_CONSOLETYPE(T)   DatablockConsoleType( T##Ptr, Type##T##Ptr, sizeof(T*), T )
#define IMPLEMENT_SETDATATYPE(T)
#define IMPLEMENT_GETDATATYPE(T)

Typedefs

typedef U32 SimTime
typedef U32 SimObjectId

Enumerations

enum  SimObjectsConstants {
  DataBlockObjectIdFirst = 3,
  DataBlockObjectIdBitSize = 10,
  DataBlockObjectIdLast = DataBlockObjectIdFirst + (1 << DataBlockObjectIdBitSize) - 1,
  MessageObjectIdFirst = DataBlockObjectIdLast + 1,
  MessageObjectIdBitSize = 6,
  MessageObjectIdLast = MessageObjectIdFirst + (1 << MessageObjectIdBitSize) - 1,
  DynamicObjectIdFirst = MessageObjectIdLast + 1,
  InvalidEventId = 0,
  RootGroupId = 0xFFFFFFFF
}
 Definition of some basic Sim system constants. More...

Functions

 Sim::DeclareNamedSet (ActiveActionMapSet) DeclareNamedSet(GhostAlwaysSet) DeclareNamedSet(LightSet) DeclareNamedSet(WayPointSet) DeclareNamedSet(fxReplicatorSet) DeclareNamedSet(fxFoliageSet) DeclareNamedSet(reflectiveSet) DeclareNamedSet(BehaviorSet) DeclareNamedSet(MaterialSet) DeclareNamedSet(SFXSourceSet)
 Sim::DeclareNamedGroup (ActionMapGroup) DeclareNamedGroup(ClientGroup) DeclareNamedGroup(GuiGroup) DeclareNamedGroup(GuiDataGroup) DeclareNamedGroup(TCPGroup) DeclareNamedGroup(ClientConnectionGroup) DeclareNamedGroup(ChunkFileGroup)
 Sim::DeclareNamedSet (sgMissionLightingFilterSet)
void Sim::init ()
void Sim::shutdown ()
SimDataBlockGroupSim::getDataBlockGroup ()
SimGroupSim::getRootGroup ()
SimObjectSim::findObject (SimObjectId)
SimObjectSim::findObject (const char *name)
template<class T>
bool Sim::findObject (SimObjectId iD, T *&t)
template<class T>
bool Sim::findObject (const char *objectName, T *&t)
void Sim::advanceToTime (SimTime time)
void Sim::advanceTime (SimTime delta)
SimTime Sim::getCurrentTime ()
SimTime Sim::getTargetTime ()
U32 Sim::postEvent (SimObject *, SimEvent *, U32 targetTime)
 a target time of 0 on an event means current event
U32 Sim::postEvent (SimObjectId iD, SimEvent *evt, U32 targetTime)
U32 Sim::postEvent (const char *objectName, SimEvent *evt, U32 targetTime)
U32 Sim::postCurrentEvent (SimObject *obj, SimEvent *evt)
U32 Sim::postCurrentEvent (SimObjectId obj, SimEvent *evt)
U32 Sim::postCurrentEvent (const char *obj, SimEvent *evt)
void Sim::cancelEvent (U32 eventId)
bool Sim::isEventPending (U32 eventId)
U32 Sim::getEventTimeLeft (U32 eventId)
U32 Sim::getTimeSinceStart (U32 eventId)
U32 Sim::getScheduleDuration (U32 eventId)
bool Sim::saveObject (SimObject *obj, Stream *stream)
SimObjectSim::loadObjectStream (Stream *stream)
bool Sim::saveObject (SimObject *obj, const char *filename)
SimObjectSim::loadObjectStream (const char *filename)


Define Documentation

#define DECLARE_CONSOLETYPE (  )     DefineConsoleType( Type##T##Ptr, T * )

#define IMPLEMENT_CONSOLETYPE (  )     DatablockConsoleType( T##Ptr, Type##T##Ptr, sizeof(T*), T )

#define IMPLEMENT_SETDATATYPE (  ) 

Value:

ConsoleSetType( Type##T##Ptr ) \
{                                                                                                 \
   volatile SimDataBlock* pConstraint = static_cast<SimDataBlock*>((T*)NULL);                     \
   pConstraint;                                                                                   \
   if (argc == 1) {                                                                               \
   *reinterpret_cast<T**>(dptr) = NULL;                                                        \
   if (argv[0] && argv[0][0] && !Sim::findObject(argv[0],*reinterpret_cast<T**>(dptr)))        \
   Con::printf("Object '%s' is not a member of the '%s' data block class", argv[0], #T);    \
   }                                                                                              \
      else                                                                                           \
      Con::printf("Cannot set multiple args to a single pointer.");                               \
}

#define IMPLEMENT_GETDATATYPE (  ) 

Value:

ConsoleGetType( Type##T##Ptr ) \
{                                                                                   \
   volatile SimDataBlock* pConstraint = static_cast<SimDataBlock*>((T*)NULL);       \
   pConstraint;                                                                     \
   T** obj = reinterpret_cast<T**>(dptr);                                           \
   char* returnBuffer = Con::getReturnBuffer(128);                                   \
   dSprintf(returnBuffer, 128, "%s", *obj && (*obj)->getName() ? (*obj)->getName() : "");\
   return returnBuffer;                                                             \
}


Typedef Documentation

typedef U32 SimTime

typedef U32 SimObjectId


Enumeration Type Documentation

Definition of some basic Sim system constants.

These constants define the range of ids assigned to datablocks (DataBlockObjectIdFirst - DataBlockObjectIdLast), and the number of bits used to store datablock IDs.

Normal Sim objects are given the range of IDs starting at DynamicObjectIdFirst and going to infinity. Sim objects use a SimObjectId to represent their ID; this is currently a U32.

The RootGroupId is assigned to gRootGroup, in which most SimObjects are addded as child members. See simManager.cc for details, particularly Sim::initRoot() and following.

Enumerator:
DataBlockObjectIdFirst 
DataBlockObjectIdBitSize 
DataBlockObjectIdLast 
MessageObjectIdFirst 
MessageObjectIdBitSize 
MessageObjectIdLast 
DynamicObjectIdFirst 
InvalidEventId 
RootGroupId