IGameObjectExtension

Interface used to implement a game object extension

C++
struct IGameObjectExtension : public IComponent {
};
File

IGameObject.h

IGameObjectExtension::~IGameObjectExtension Destructor
C++
IGameObjectExtension::FullSerialize Method

Performs the serialization the extension

C++
virtual void FullSerialize(TSerialize ser) = 0;
Parameters
Parameters
Description
TSerialize ser
object used to serialize values
aspect
serialization aspect, used for network serialization
profile
which profile to serialize; 255 == don't care
flags
physics flags to be used for serialization
See Also

ISerialize

IGameObjectExtension::GetEntity Method

Retrieves the pointer to the entity

C++
IEntity * GetEntity() const;
Returns

A pointer to the entity which hold this game object extension

IGameObjectExtension::GetEntityId Method

Retrieves the EntityId

C++
EntityId GetEntityId() const;
Returns

An EntityId to the entity which hold this game object extension

IGameObjectExtension::GetEntityPoolSignature Method

Builds a signature to describe the dynamic hierarchy of the parent Entity container

C++
virtual bool GetEntityPoolSignature(TSerialize signature) = 0;
Parameters
Parameters
Description
TSerialize signature
the object to serialize with, forming the signature
Returns

true - If the signature is thus far valid

Notes

It's the responsibility of the proxy to identify its internal state which may complicate the hierarchy of the parent Entity i.e., sub-proxies and which actually exist for this instantiation.

IGameObjectExtension::GetEventPriority Method
C++
virtual ComponentEventPriority GetEventPriority(const int eventID) const;
Description

IComponent

IGameObjectExtension::GetGameObject Method

Retrieves the pointer to the game object

C++
IGameObject * GetGameObject() const;
Returns

A pointer to the game object which hold this extension

IGameObjectExtension::GetMemoryUsage Method
C++
virtual void GetMemoryUsage(ICrySizer * pSizer) const = 0;
IGameObjectExtension::GetNetSerializeAspects Method

Return the aspects NetSerialize serializes. Overriding this to return only the aspects used will speed up the net bind of the object.

C++
virtual NetworkAspectType GetNetSerializeAspects();
IGameObjectExtension::GetRMIBase Method

Retrieves the RMI Base pointer

C++
virtual const void * GetRMIBase() const = 0;
Description

Internal function used for RMI. It's usually implemented by CGameObjectExtensionHelper provides a way of checking who should receive some RMI call.

IGameObjectExtension::GetSpawnInfo Method
C++
virtual ISerializableInfoPtr GetSpawnInfo() = 0;
IGameObjectExtension::HandleEvent Method

Processes game specific events

C++
virtual void HandleEvent(const SGameObjectEvent& event) = 0;
Parameters
Parameters
Description
const SGameObjectEvent& event
game event
See Also
IGameObjectExtension::IGameObjectExtension Constructor
C++
IGameObjectExtension();
IGameObjectExtension::Init Method

Initialize the extension

C++
virtual bool Init(IGameObject * pGameObject) = 0;
Parameters
Parameters
Description
IGameObject * pGameObject
a pointer to the game object which will use the extension
Remarks

IMPORTANT: It's very important that the implementation of this function call the protected function SetGameObject() during the execution of the Init() function. Unexpected results would happen otherwise.

IGameObjectExtension::InitClient Method

Initialize the extension (client only)

C++
virtual void InitClient(int channelId) = 0;
Parameters
Parameters
Description
int channelId
id of the server channel of the client to receive the initialization
Description

This initialization function should be use to initialize resource only used in the client

IGameObjectExtension::NetSerialize Method
C++
virtual bool NetSerialize(TSerialize ser, EEntityAspects aspect, uint8 profile, int pflags) = 0;
IGameObjectExtension::PostInit Method

Post-initialize the extension

C++
virtual void PostInit(IGameObject * pGameObject) = 0;
Parameters
Parameters
Description
IGameObject * pGameObject
a pointer to the game object which owns the extension
Description

During the post-initialization, the extension is now contained in the game object

IGameObjectExtension::PostInitClient Method

Post-initialize the extension (client only)

C++
virtual void PostInitClient(int channelId) = 0;
Parameters
Parameters
Description
int channelId
id of the server channel of the client to receive the initialization
Description

This initialization function should be use to initialize resource only used in the client. During the post-initialization, the extension is now contained in the game object

IGameObjectExtension::PostReloadExtension Method

Post-reload the extension

C++
virtual void PostReloadExtension(IGameObject * pGameObject, const SEntitySpawnParams & params) = 0;
Parameters
Parameters
Description
IGameObject * pGameObject
a pointer to the game object which owns the extension
Description

Called when owning entity is reloaded and all its extensions have either either been reloaded or destroyed

IGameObjectExtension::PostRemoteSpawn Method
C++
virtual void PostRemoteSpawn() = 0;
Description

Summary

IGameObjectExtension::PostSerialize Method

Performs post serialization fixes

C++
virtual void PostSerialize() = 0;
IGameObjectExtension::PostUpdate Method

Performs an additional update

C++
virtual void PostUpdate(float frameTime) = 0;
Parameters
Parameters
Description
float frameTime
time elapsed since the last frame update
See Also
IGameObjectExtension::ProcessEvent Method

Processes entity specific events

C++
virtual void ProcessEvent(SEntityEvent& event) = 0;
Parameters
Parameters
Description
SEntityEvent& event
entity event, see SEntityEvent for more information
IGameObjectExtension::Release Method

Releases the resources used by the object

C++
virtual void Release() = 0;
Remarks

This function should also take care of freeing the instance once the resource are freed.

IGameObjectExtension::ReloadExtension Method

Reload the extension

C++
virtual bool ReloadExtension(IGameObject * pGameObject, const SEntitySpawnParams & params) = 0;
Parameters
Parameters
Description
IGameObject * pGameObject
a pointer to the game object which owns the extension
Returns

TRUE if the extension should be kept, FALSE if it should be removed

Description

Called when owning entity is reloaded

Remarks

IMPORTANT: It's very important that the implementation of this function call the protected function ResetGameObject() during the execution of the ReloadExtension() function. Unexpected results would happen otherwise.

IGameObjectExtension::ResetGameObject Method
C++
void ResetGameObject();
IGameObjectExtension::SerializeSpawnInfo Method

Performs the serialization of special spawn information

C++
virtual void SerializeSpawnInfo(TSerialize ser) = 0;
Parameters
Parameters
Description
TSerialize ser
object used to serialize values
See Also

Serialize, ISerialize

IGameObjectExtension::SetAuthority Method
C++
virtual void SetAuthority(bool auth) = 0;
IGameObjectExtension::SetChannelId Method
C++
virtual void SetChannelId(uint16 id) = 0;
IGameObjectExtension::SetGameObject Method
C++
void SetGameObject(IGameObject * pGameObject);
IGameObjectExtension::Update Method

Performs frame dependent extension updates

C++
virtual void Update(SEntityUpdateContext& ctx, int updateSlot) = 0;
Parameters
Parameters
Description
SEntityUpdateContext& ctx
Update context
int updateSlot
updateSlot
See Also