class MAGES::SceneGraph::SceneGraphUtility

Overview

Utility class for all things scenegraph. More…

class SceneGraphUtility
{
public:
    // structs

    struct EffectDataFieldInfo;

    // methods

    static bool IsEffectDataPropertyVisible(
        System.Type actionDataContext,
        System.Reflection.FieldInfo field
    );

    static IEnumerable GetAllActionDataTypes();
    static IEnumerable GetAllEffectDataTypes();
    static IEnumerable GetAvailableEffectDataTypes(System.Type actionDataType);
    static IEnumerable GetAllEffectImplementorTypes();
    static void CreateEffectImplementorsForAction(BaseActionData actionData);

    static System.Type GetEffectImplementor(
        System.Type effectDataType,
        System.Type actionDataType
    );

    static ImplementsEffectAttribute GetImplementorAttribute(System.Type implementorType);
    static IEnumerable GetEffectImplementorsByAction(System.Type actionDataType);

    static bool ImplementsSomeEffectForAction(
        System.Type implementorType,
        System.Type actionDataType
    );

    static bool TryGetImplementorEffectAndAction(
        System.Type implementorType,
        out System.Type effectDataType,
        out System.Type actionDataType
    );

    static System.Type FindEffectImplementor(
        System.Type effectDataType,
        IEnumerable actionDataTypes
    );

    static bool IsEffectImplementedForAction(
        System.Type effectDataType,
        System.Type actionDataType
    );

    static IEnumerable<EffectDataFieldInfo> GetEffectDataFieldInfoForActions(
        System.Type effectDataType,
        IEnumerable actionTypes
    );

    static string ToHumanReadableActionTypeName(this System.Type t);
    static string ToHumanReadableEffectTypeName(this System.Type t);
    static string ToHumanReadableStepName(this System.Type t);
};

Detailed Documentation

Utility class for all things scenegraph.

Methods

static bool IsEffectDataPropertyVisible(
    System.Type actionDataContext,
    System.Reflection.FieldInfo field
)

Returns true if the field is visible for the given action data context.

Parameters:

actionDataContext

The action data context.

field

The field to check.

Returns:

Whether (or not) the field should be displayed in the inspector for the given action.

static IEnumerable GetAllActionDataTypes()

Gets all action data types.

Returns:

An enumerable of action data types.

static IEnumerable GetAllEffectDataTypes()

Gets all effect data types.

Returns:

An enumerable of effect data types.

static IEnumerable GetAvailableEffectDataTypes(System.Type actionDataType)

Returns all the effects that have implementors for this action.

Parameters:

actionDataType

The action data type.

Returns:

Enumerable of EffectData derivatives.

static IEnumerable GetAllEffectImplementorTypes()

Gets all effect implementor types.

Returns:

An enumerable of effect implementor types.

static void CreateEffectImplementorsForAction(BaseActionData actionData)

Implenents the effects for the given action data.

Parameters:

actionData

The given ActionData.

static System.Type GetEffectImplementor(
    System.Type effectDataType,
    System.Type actionDataType
)

Returns the effect implementor for the given effect data and action data.

Parameters:

effectDataType

Set the effect Data Type.

actionDataType

Set the ActionData type.

Returns:

The edffect Implementor.

static ImplementsEffectAttribute GetImplementorAttribute(System.Type implementorType)

Gets the implementor attribute for the given implementor type.

Parameters:

implementorType

Set the Implementor Type.

Returns:

The immplementor attribute.

static IEnumerable GetEffectImplementorsByAction(System.Type actionDataType)

Gets all the effect implementors for the given action data type.

Parameters:

actionDataType

Set the Implementor Type.

Returns:

All the effect implementor types.

static bool ImplementsSomeEffectForAction(
    System.Type implementorType,
    System.Type actionDataType
)

Implements the given effect for the given action.

Parameters:

implementorType

The effect to implement.

actionDataType

The given Action.

Returns:

True if everything was ok.

static bool TryGetImplementorEffectAndAction(
    System.Type implementorType,
    out System.Type effectDataType,
    out System.Type actionDataType
)

Try get the effect and action data types for the given implementor type.

Parameters:

implementorType

Set the implementor type.

effectDataType

Set the effect data type.

actionDataType

Set the action data type.

Returns:

The bool value.

static System.Type FindEffectImplementor(
    System.Type effectDataType,
    IEnumerable actionDataTypes
)

Find the effect implementor for the given effect data type and action data types.

Parameters:

effectDataType

Set the effect data type.

actionDataTypes

Set the action data types.

Returns:

The returned type.

static bool IsEffectImplementedForAction(
    System.Type effectDataType,
    System.Type actionDataType
)

Check if the effect is implemented for the given action.

Parameters:

effectDataType

Set the effect data type.

actionDataType

Set the action data type.

Returns:

The result.

static IEnumerable<EffectDataFieldInfo> GetEffectDataFieldInfoForActions(
    System.Type effectDataType,
    IEnumerable actionTypes
)

Gets all the effect implementors for the given action data type.

Parameters:

effectDataType

The given effect data type.

actionTypes

The give action types.

Returns:

The data field.

static string ToHumanReadableActionTypeName(this System.Type t)

Converts the given type to a human readable string.

Parameters:

t

The given type.

Returns:

The type name.

static string ToHumanReadableEffectTypeName(this System.Type t)

Converts the given type to a human readable string.

Parameters:

t

The given type.

Returns:

The type name.

static string ToHumanReadableStepName(this System.Type t)

Generate a human readable name from a step type.

Parameters:

t

The step type.

Returns:

The human readable name.