From 15740faf9fe9fe4be08965098bbf2947e096aeeb Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 14 Aug 2019 22:50:43 +0800 Subject: +Unity Runtime code --- Runtime/Misc/ComponentRequirement.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Runtime/Misc/ComponentRequirement.h (limited to 'Runtime/Misc/ComponentRequirement.h') diff --git a/Runtime/Misc/ComponentRequirement.h b/Runtime/Misc/ComponentRequirement.h new file mode 100644 index 0000000..50f3dde --- /dev/null +++ b/Runtime/Misc/ComponentRequirement.h @@ -0,0 +1,33 @@ +#ifndef COMPONENTREQUIREMENT_H +#define COMPONENTREQUIREMENT_H +#include "Runtime/Utilities/vector_set.h" +#include +#include +#include +#include + +// Returns all components that are required for a component +// of componentClassID to run. +const vector_set& FindRequiredComponentsForComponent (int componentClassID); +void FindAllRequiredComponentsRecursive (int componentClassID, vector_set& results); +const vector_set& FindConflictingComponents (int classID); + +// Can the component with componentClassID, be more than once in a gameobject? +bool DoesComponentAllowMultipleInclusion (int componentClassID); + +struct GOComponentDescription +{ + int classID; + std::string name; + GOComponentDescription (const std::string& inName, int inClassID) { name = inName; classID = inClassID; } +}; + +typedef std::list > > ComponentsHierarchy; +// Returns a sorted hierarchy of components +const ComponentsHierarchy& GetComponentsHierarchy (); + +int GetAllowComponentReplacementClass (int classID); + +void InitComponentRequirements (); + +#endif -- cgit v1.1-26-g67d0