| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- #pragma once
- #include "BsCorePrerequisites.h"
- namespace BansheeEngine
- {
- /**
- * @brief Contains information about a resource dependency, including
- * the dependant resource and number of references to it.
- */
- struct ResourceDependency
- {
- ResourceDependency()
- :numReferences(0)
- { }
- HResource resource;
- UINT32 numReferences;
- };
- /**
- * @brief Static class containing various utility methods that do not
- * fit anywhere else.
- */
- class BS_CORE_EXPORT Utility
- {
- public:
- /**
- * @brief Finds all resources referenced by the specified object.
- *
- * @param object Object to search for resource dependencies.
- * @param recursive Determines whether or not child objects will also be
- * searched (if object has any children).
- *
- * @returns A list of unique, non-null resources.
- */
- static Vector<ResourceDependency> findResourceDependencies(IReflectable& object, bool recursive = true);
- private:
- /**
- * @brief Helper method for for recursion when finding resource dependencies.
- *
- * @see findDependencies
- */
- static void findResourceDependenciesInternal(IReflectable& object, bool recursive, Map<String, ResourceDependency>& dependencies);
- /**
- * @brief Checks if the specified type (or any of its derived classes) have any IReflectable pointer or value
- * types as their fields.
- */
- static bool hasReflectableChildren(RTTITypeBase* type);
- };
- }
|