Make GetObject virtual and implement for Grid
This commit is contained in:
@@ -186,6 +186,18 @@ bool NetworkReplicationGridNode::RemoveObject(ScriptingObject* obj)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool NetworkReplicationGridNode::GetObject(ScriptingObject* obj, NetworkReplicationHierarchyObject& result)
|
||||||
|
{
|
||||||
|
for (const auto& e : _children)
|
||||||
|
{
|
||||||
|
if (e.Value.Node->GetObject(obj, result))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void NetworkReplicationGridNode::Update(NetworkReplicationHierarchyUpdateResult* result)
|
void NetworkReplicationGridNode::Update(NetworkReplicationHierarchyUpdateResult* result)
|
||||||
{
|
{
|
||||||
CHECK(result);
|
CHECK(result);
|
||||||
|
|||||||
@@ -206,7 +206,7 @@ API_CLASS(Abstract, Namespace = "FlaxEngine.Networking") class FLAXENGINE_API Ne
|
|||||||
/// <param name="obj">The object to get.</param>
|
/// <param name="obj">The object to get.</param>
|
||||||
/// <param name="result">The hierarchy object to retrieve.</param>
|
/// <param name="result">The hierarchy object to retrieve.</param>
|
||||||
/// <returns>True on successful retrieval, otherwise false.</returns>
|
/// <returns>True on successful retrieval, otherwise false.</returns>
|
||||||
API_FUNCTION() bool GetObject(ScriptingObject* obj, NetworkReplicationHierarchyObject& result);
|
API_FUNCTION() virtual bool GetObject(ScriptingObject* obj, NetworkReplicationHierarchyObject& result);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Force replicates the object during the next update. Resets any internal tracking state to force the synchronization.
|
/// Force replicates the object during the next update. Resets any internal tracking state to force the synchronization.
|
||||||
@@ -255,6 +255,7 @@ public:
|
|||||||
|
|
||||||
void AddObject(NetworkReplicationHierarchyObject obj) override;
|
void AddObject(NetworkReplicationHierarchyObject obj) override;
|
||||||
bool RemoveObject(ScriptingObject* obj) override;
|
bool RemoveObject(ScriptingObject* obj) override;
|
||||||
|
bool GetObject(ScriptingObject* obj, NetworkReplicationHierarchyObject& result) override;
|
||||||
void Update(NetworkReplicationHierarchyUpdateResult* result) override;
|
void Update(NetworkReplicationHierarchyUpdateResult* result) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user