|
|
@@ -165,14 +165,22 @@ public:
|
|
|
void UnregisterVar(const String& name);
|
|
|
/// Clear all registered node user variable hash reverse mappings.
|
|
|
void UnregisterAllVars();
|
|
|
+ /// Register a node Tag.
|
|
|
+ void RegisterTag(const String& name);
|
|
|
+ /// Unregister a node Tag and if set remove Tag from nodes.
|
|
|
+ void UnregisterTag(const String& name);
|
|
|
+ /// Clear all registered node Tag.
|
|
|
+ void UnregisterAllTags();
|
|
|
|
|
|
/// Return node from the whole scene by ID, or null if not found.
|
|
|
Node* GetNode(unsigned id) const;
|
|
|
/// Return component from the whole scene by ID, or null if not found.
|
|
|
Component* GetComponent(unsigned id) const;
|
|
|
-
|
|
|
- /// Return whether updates are enabled.
|
|
|
- bool IsUpdateEnabled() const { return updateEnabled_; }
|
|
|
+ /// Get nodes with specific tag from the whole scene, return false if empty.
|
|
|
+ bool GetNodesWithTag(PODVector<Node*>& dest, StringHash tag) const;
|
|
|
+
|
|
|
+ /// Return whether updates are enabled.
|
|
|
+ bool IsUpdateEnabled() const { return updateEnabled_; }
|
|
|
|
|
|
/// Return whether an asynchronous loading operation is in progress.
|
|
|
bool IsAsyncLoading() const { return asyncLoading_; }
|
|
|
@@ -207,8 +215,10 @@ public:
|
|
|
/// Return required package files.
|
|
|
const Vector<SharedPtr<PackageFile> >& GetRequiredPackageFiles() const { return requiredPackageFiles_; }
|
|
|
|
|
|
- /// Return a node user variable name, or empty if not registered.
|
|
|
- const String& GetVarName(StringHash hash) const;
|
|
|
+ /// Return a node user variable name, or empty if not registered.
|
|
|
+ const String& GetVarName(StringHash hash) const;
|
|
|
+ /// Return a node tag name, or empty if not registered.
|
|
|
+ const String& GetTagName(StringHash tag) const;
|
|
|
|
|
|
/// Update scene. Called by HandleUpdate.
|
|
|
void Update(float timeStep);
|
|
|
@@ -226,6 +236,8 @@ public:
|
|
|
unsigned GetFreeNodeID(CreateMode mode);
|
|
|
/// Get free component ID, either non-local or local.
|
|
|
unsigned GetFreeComponentID(CreateMode mode);
|
|
|
+ /// Cache node by tag if tag not zero.
|
|
|
+ void NodeTagChanged(Node* node, StringHash oldTag);
|
|
|
/// Node added. Assign scene pointer and add to ID map.
|
|
|
void NodeAdded(Node* node);
|
|
|
/// Node removed. Remove from ID map.
|
|
|
@@ -238,6 +250,10 @@ public:
|
|
|
void SetVarNamesAttr(const String& value);
|
|
|
/// Return node user variable reverse mappings.
|
|
|
String GetVarNamesAttr() const;
|
|
|
+ /// Set node tag reverse mappings.
|
|
|
+ void SetTagNamesAttr(const String& value);
|
|
|
+ /// Return node tag reverse mappings.
|
|
|
+ String GetTagNamesAttr() const;
|
|
|
/// Prepare network update by comparing attributes and marking replication states dirty as necessary.
|
|
|
void PrepareNetworkUpdate();
|
|
|
/// Clean up all references to a network connection that is about to be removed.
|
|
|
@@ -277,6 +293,8 @@ private:
|
|
|
HashMap<unsigned, Component*> replicatedComponents_;
|
|
|
/// Local components by ID.
|
|
|
HashMap<unsigned, Component*> localComponents_;
|
|
|
+ /// Cached taged nodes by tag.
|
|
|
+ HashMap<StringHash, PODVector<Node*> > tagedNodes_;
|
|
|
/// Asynchronous loading progress.
|
|
|
AsyncProgress asyncProgress_;
|
|
|
/// Node and component ID resolver for asynchronous loading.
|
|
|
@@ -287,6 +305,8 @@ private:
|
|
|
Vector<SharedPtr<PackageFile> > requiredPackageFiles_;
|
|
|
/// Registered node user variable reverse mappings.
|
|
|
HashMap<StringHash, String> varNames_;
|
|
|
+ /// Registered node tag reverse mappings.
|
|
|
+ HashMap<StringHash, String> tagNames_;
|
|
|
/// Nodes to check for attribute changes on the next network update.
|
|
|
HashSet<unsigned> networkUpdateNodes_;
|
|
|
/// Components to check for attribute changes on the next network update.
|