GameBaseData
Engine/source/T3D/gameBase/gameBase.h
Scriptable, demo-able datablock.
Callbacks
DECLARE_CALLBACK(void , onAdd , (GameBase *obj) )
DECLARE_CALLBACK(void , onRemove , (GameBase *obj) )
DECLARE_CALLBACK(void , onNewDataBlock , (GameBase *obj) )
DECLARE_CALLBACK(void , onMount , (SceneObject *obj, SceneObject *mountObj, S32 node) )
DECLARE_CALLBACK(void , onUnmount , (SceneObject *obj, SceneObject *mountObj, S32 node) )
Private Types
Parent
Public Attributes
Public Functions
GameBaseData(const GameBaseData & , bool )
Called after any property of the object is changed in the world editor.
bool
onAdd()
Called when the object is added to the sim.
bool
unpackData(BitStream * stream)
Public Static Functions
Detailed Description
Scriptable, demo-able datablock.
This variant of SimDataBlock performs these additional tasks:
Linking datablock's namepsaces to the namespace of their C++ class, so that datablocks can expose script functionality.
Linking datablocks to a user defined scripting namespace, by setting the 'class' field at datablock definition time.
Adds a category field; this is used by the world creator in the editor to classify creatable shapes. Creatable shapes are placed under the Shapes node in the treeview for this; additional levels are created, named after the category fields.
Adds support for demo stream recording. This support takes the form of the member variable packed. When a demo is being recorded by a client, data is unpacked, then packed again to the data stream, then, in the case of datablocks, preload() is called to process the data. It is occasionally the case that certain references in the datablock stream cannot be resolved until preload is called, in which case a raw ID field is stored in the variable which will eventually be used to store a pointer to the object. However, if packData() is called before we resolve this ID, trying to call getID() on the objecct ID would be a fatal error. Therefore, in these cases, we test packed; if it is true, then we know we have to write the raw data, instead of trying to resolve an ID.
SimDataBlock for further details about datablocks.
Callbacks
DECLARE_CALLBACK(void , onAdd , (GameBase *obj) )
DECLARE_CALLBACK(void , onRemove , (GameBase *obj) )
DECLARE_CALLBACK(void , onNewDataBlock , (GameBase *obj) )
DECLARE_CALLBACK(void , onMount , (SceneObject *obj, SceneObject *mountObj, S32 node) )
DECLARE_CALLBACK(void , onUnmount , (SceneObject *obj, SceneObject *mountObj, S32 node) )
Private Types
typedef SimDataBlock Parent
Public Attributes
StringTableEntry mCategory
bool mPacked
Signal< void(void)> mReloadSignal
Public Functions
GameBaseData()
GameBaseData(const GameBaseData & , bool )
DECLARE_CONOBJECT(GameBaseData )
inspectPostApply()
Reimplemented from: SimObject
Reimplemented by: ShapeBaseImageData
onAdd()
Reimplemented from: SimDataBlock
Reimplemented by: PhysicsDebrisData, PhysicsShapeData, ProjectileData, RigidShapeData, ShapeBaseImageData, TriggerData, AITurretShapeData, HoverVehicleData
preload(bool server, String & errorStr)
Reimplemented from: SimDataBlock
Reimplemented by: VHumanoidActorData, PhysicsShapeData, PathShapeData, PhysicsDebrisData, PlayerData, ProjectileData, ProximityMineData, RigidShapeData, ShapeBaseImageData, ShapeBaseData, AITurretShapeData, TurretShapeData, FlyingVehicleData, HoverVehicleData, VehicleData, WheeledVehicleData
unpackData(BitStream * stream)
Reimplemented from: SimDataBlock
Reimplemented by: ProjectileData, RigidShapeData, HoverVehicleData, VActorData, ItemData, PathCameraData, PathShapeData, PhysicsDebrisData, PhysicsShapeData, PlayerData, ProximityMineData, ShapeBaseImageData, ShapeBaseData, StaticShapeData, TriggerData, AITurretShapeData, TurretShapeData, FlyingVehicleData, VehicleData, WheeledVehicleData