PrefabDiff Class Reference

Description

Contains modifications between an prefab and its instance.

The modifications are a set of added/removed children or components and per-field "diffs" of their components.

Inherits IReflectable.

Methods

void apply (const HSceneObject &object)
 Applies the internal prefab diff to the provided object. More...
 
RTTITypeBasegetRTTI () const override
 Returns an interface you can use to access class' Run Time Type Information. More...
 
- Methods inherited from IReflectable
bool isDerivedFrom (RTTITypeBase *base)
 Returns true if current RTTI class is derived from base (Or if it is the same type as base). More...
 
UINT32 getTypeId () const
 Returns an unique type identifier of the class. More...
 
const StringgetTypeName () const
 Returns the type name of the class. More...
 

Static methods

static SPtr< PrefabDiffcreate (const HSceneObject &prefab, const HSceneObject &instance)
 Creates a new prefab diff by comparing the provided instanced scene object hierarchy with the prefab scene object hierarchy.
 
static RTTITypeBasegetRTTIStatic ()
 
- Static methods inherited from IReflectable
static Vector< RTTITypeBase * > & getDerivedClasses ()
 Returns all classes deriving directly from IReflectable. More...
 
static SPtr< IReflectablecreateInstanceFromTypeId (UINT32 rttiTypeId)
 Creates an empty instance of a class from a type identifier. More...
 
static void _registerDerivedClass (RTTITypeBase *derivedClass)
 Called by each type deriving from IReflectable, on program load. More...
 
static RTTITypeBase_getRTTIfromTypeId (UINT32 rttiTypeId)
 Returns class' RTTI type from type id. More...
 
static bool _isTypeIdDuplicate (UINT32 typeId)
 Checks if the provided type id is unique. More...
 
static void _checkForCircularReferences ()
 Iterates over all RTTI types and reports any circular references (for example one type having a field referencing another type, and that type having a field referencing the first type). More...
 
static RTTITypeBasegetRTTIStatic ()
 Returns an interface you can use to access class' Run Time Type Information. More...
 

Method documentation

void apply ( const HSceneObject object)

Applies the internal prefab diff to the provided object.

The object should have similar hierarchy as the prefab the diff was created for, otherwise the results are undefined.

Note
Be aware that this method will not instantiate newly added components or scene objects. It's expected that this method will be called on a fresh copy of a scene object hierarchy, and everything to be instantiated at once after diff is applied.
RTTITypeBase* getRTTI ( ) const
overridevirtual

Returns an interface you can use to access class' Run Time Type Information.

Note
You must derive your own version of RTTITypeBase, in which you may encapsulate all reflection specific operations.

Implements IReflectable.