Table of Contents

Class DynamicVariableExtensions

Namespace
MonkeyLoader.Resonite
Assembly
MonkeyLoader.Resonite.Core.dll

Contains extension methods related to FrooxEngine.DynamicVariableSpaces and their variables.

public static class DynamicVariableExtensions
Inheritance
DynamicVariableExtensions
Inherited Members

Fields

SharedConfigIdentifier

The name of the shared config slot in a FrooxEngine.World's Assets FrooxEngine.Slot.
The prefix for the names of Dynamic Variables that are part of the shared config.

public const string SharedConfigIdentifier = "MonkeyLoader.SharedConfig"

Field Value

string

Methods

CreateSpace(Slot, string?, bool)

Attaches a FrooxEngine.DynamicVariableSpace component to this slot with the given spaceName and optionally enables OnlyDirectBinding.

public static DynamicVariableSpace CreateSpace(this Slot slot, string? spaceName, bool onlyDirectBinding = false)

Parameters

slot Slot

The slot to create the component on.

spaceName string

The name for the created space.

onlyDirectBinding bool

Whether only variables with a matching space name should bind to the created space.

Returns

DynamicVariableSpace

The created FrooxEngine.DynamicVariableSpace component.

FindOrCreateSpace(Slot, string?, bool)

Searches for a FrooxEngine.DynamicVariableSpace with the given spaceName that covers this slot, or attaches one to it with the given parameters.

public static DynamicVariableSpace FindOrCreateSpace(this Slot slot, string? spaceName, bool onlyDirectBinding = false)

Parameters

slot Slot

The slot to create the component on.

spaceName string

The name for the created space.

onlyDirectBinding bool

Whether only variables with a matching space name should bind to the created space.

Returns

DynamicVariableSpace

The found or attached FrooxEngine.DynamicVariableSpace.

Remarks

The found FrooxEngine.DynamicVariableSpace's OnlyDirectBinding option may differ from the supplied value.

GetAllLinkedVariables(DynamicVariableSpace, Func<IDynamicVariable, bool>?)

Gets all dynamic variable components linked to this FrooxEngine.DynamicVariableSpace that optionally have to pass the given filter predicate.

public static IEnumerable<IDynamicVariable> GetAllLinkedVariables(this DynamicVariableSpace space, Func<IDynamicVariable, bool>? predicate = null)

Parameters

space DynamicVariableSpace

The dynamic variable space to get the linked variables of.

predicate Func<IDynamicVariable, bool>

Optional predicate to filter the potential linked variables with.

Returns

IEnumerable<IDynamicVariable>

The dynamic variable components linked to this FrooxEngine.DynamicVariableSpace that optionally pass the given filter predicate.

GetAllLinkedVariablesMatching(DynamicVariableSpace, DynamicVariableIdentity)

Gets all dynamic variable components linked to this FrooxEngine.DynamicVariableSpace that match the given identity in all but the space.

public static IEnumerable<IDynamicVariable> GetAllLinkedVariablesMatching(this DynamicVariableSpace space, DynamicVariableIdentity identity)

Parameters

space DynamicVariableSpace

The dynamic variable space to get the linked variables of.

identity DynamicVariableIdentity

The Dynamic Variable identity describing the Type and name of the dynamic variables.

Returns

IEnumerable<IDynamicVariable>

All dynamic variable components linked to this FrooxEngine.DynamicVariableSpace that have the Type and name defined by the given identity.

GetAllLinkedVariablesMatching(DynamicVariableSpace, Type, string)

Gets all dynamic variable components linked to this FrooxEngine.DynamicVariableSpace that have the given type and name.

public static IEnumerable<IDynamicVariable> GetAllLinkedVariablesMatching(this DynamicVariableSpace space, Type type, string name)

Parameters

space DynamicVariableSpace

The dynamic variable space to get the linked variables of.

type Type

The type of the values of the dynamic variables.

name string

The name of the dynamic variables.

Returns

IEnumerable<IDynamicVariable>

All dynamic variable components linked to this FrooxEngine.DynamicVariableSpace that have the given type and name.

GetAllLinkedVariablesMatching<T>(DynamicVariableSpace, string)

Gets all dynamic variable components linked to this FrooxEngine.DynamicVariableSpace that have the given type and name.

public static IEnumerable<IDynamicVariable<T>> GetAllLinkedVariablesMatching<T>(this DynamicVariableSpace space, string name)

Parameters

space DynamicVariableSpace

The dynamic variable space to get the linked variables of.

name string

The name of the dynamic variables.

Returns

IEnumerable<IDynamicVariable<T>>

All dynamic variable components linked to this FrooxEngine.DynamicVariableSpace that have the given type and name.

Type Parameters

T

The type of the values of the dynamic variables.

GetAllLinkedVariables<T>(DynamicVariableSpace, Func<IDynamicVariable<T>, bool>?)

Gets all dynamic variable components linked to this FrooxEngine.DynamicVariableSpace that optionally have to pass the given filter predicate.

public static IEnumerable<IDynamicVariable<T>> GetAllLinkedVariables<T>(this DynamicVariableSpace space, Func<IDynamicVariable<T>, bool>? predicate = null)

Parameters

space DynamicVariableSpace

The dynamic variable space to get the linked variables of.

predicate Func<IDynamicVariable<T>, bool>

Optional predicate to filter the potential linked variables with.

Returns

IEnumerable<IDynamicVariable<T>>

The dynamic variable components linked to this FrooxEngine.DynamicVariableSpace that optionally pass the given filter predicate.

Type Parameters

T

The type of the values of the dynamic variables.

GetAvailableSpaces(Slot, Predicate<DynamicVariableSpace>?)

Gets all FrooxEngine.DynamicVariableSpaces that apply to this FrooxEngine.Slot.
Optionally includes only those that pass through the filter.

public static IEnumerable<DynamicVariableSpace> GetAvailableSpaces(this Slot slot, Predicate<DynamicVariableSpace>? filter = null)

Parameters

slot Slot

The FrooxEngine.Slot to find all applicable FrooxEngine.DynamicVariableSpaces for.

filter Predicate<DynamicVariableSpace>

The optional predicate to apply to the returned

Returns

IEnumerable<DynamicVariableSpace>

All FrooxEngine.DynamicVariableSpace that apply to this FrooxEngine.Slot and optionally pass the filter.

Remarks

This function is different from a regular FrooxEngine.Slot.GetComponentsInParents<FrooxEngine.DynamicVariableSpace>() call,
as it considers that FrooxEngine.DynamicVariableSpaces deeper in the hierarchy hide ones higher up with the same name.
If a FrooxEngine.DynamicVariableSpace deeper in the hierarchy doesn't pass the filter,
it will still hide any higher up ones with the same name that might pass it, because they don't apply to this FrooxEngine.Slot.

GetAvailableVariableIdentities(Slot)

Gets all full Dynamic Variable identities that apply to this FrooxEngine.Slot

public static IEnumerable<DynamicVariableIdentity> GetAvailableVariableIdentities(this Slot slot)

Parameters

slot Slot

The FrooxEngine.Slot to find all applicable full Dynamic Variable identities for.

Returns

IEnumerable<DynamicVariableIdentity>

All full Dynamic Variable identities that apply to this FrooxEngine.Slot.

Remarks

This method uses slot.GetAvailableSpaces(),
which is different from a regular slot.GetComponentsInParents<FrooxEngine.DynamicVariableSpace>() call,
as it considers that FrooxEngine.DynamicVariableSpaces deeper in the hierarchy hide ones higher up with the same name.

GetAvailableVariableIdentities(Slot, string)

Gets all full Dynamic Variable identities that apply to this FrooxEngine.Slot, which match the given name.

public static IEnumerable<DynamicVariableIdentity> GetAvailableVariableIdentities(this Slot slot, string name)

Parameters

slot Slot

The FrooxEngine.Slot to find all applicable full Dynamic Variable identities for.

name string

The name that the variable identities must have.

Returns

IEnumerable<DynamicVariableIdentity>

All full Dynamic Variable identities that apply to this FrooxEngine.Slot that have the given name.

Remarks

This method uses slot.GetAvailableSpaces(),
which is different from a regular slot.GetComponentsInParents<FrooxEngine.DynamicVariableSpace>() call,
as it considers that FrooxEngine.DynamicVariableSpaces deeper in the hierarchy hide ones higher up with the same name.

GetAvailableVariableIdentities(Slot, Type)

Gets all full Dynamic Variable identities that apply to this FrooxEngine.Slot, which can be assigned a value of the given Type.

public static IEnumerable<DynamicVariableIdentity> GetAvailableVariableIdentities(this Slot slot, Type type)

Parameters

slot Slot

The FrooxEngine.Slot to find all applicable full Dynamic Variable identities for.

type Type

The type that must be assignable to the variables.

Returns

IEnumerable<DynamicVariableIdentity>

All full Dynamic Variable identities that apply to this FrooxEngine.Slot that the given Type can be assigned to.

Remarks

This method uses slot.GetAvailableSpaces(),
which is different from a regular slot.GetComponentsInParents<FrooxEngine.DynamicVariableSpace>() call,
as it considers that FrooxEngine.DynamicVariableSpaces deeper in the hierarchy hide ones higher up with the same name.

GetAvailableVariableIdentities(Slot, Type, string)

Gets all full Dynamic Variable identities that apply to this FrooxEngine.Slot, which can be assigned a value of the given Type and which match the given name.

public static IEnumerable<DynamicVariableIdentity> GetAvailableVariableIdentities(this Slot slot, Type type, string name)

Parameters

slot Slot

The FrooxEngine.Slot to find all applicable full Dynamic Variable identities for.

type Type

The type that must be assignable to the variables.

name string

The name that the variable identities must have.

Returns

IEnumerable<DynamicVariableIdentity>

All full Dynamic Variable identities that apply to this FrooxEngine.Slot that the given Type can be assigned to and that have the given name.

Remarks

This method uses slot.GetAvailableSpaces(),
which is different from a regular slot.GetComponentsInParents<FrooxEngine.DynamicVariableSpace>() call,
as it considers that FrooxEngine.DynamicVariableSpaces deeper in the hierarchy hide ones higher up with the same name.

GetAvailableVariableIdentitiesBySpace(Slot)

Gets all full Dynamic Variable identities that apply to this FrooxEngine.Slot

public static IDictionary<DynamicVariableSpace, IEnumerable<DynamicVariableIdentity>> GetAvailableVariableIdentitiesBySpace(this Slot slot)

Parameters

slot Slot

The FrooxEngine.Slot to find all applicable full Dynamic Variable identities for.

Returns

IDictionary<DynamicVariableSpace, IEnumerable<DynamicVariableIdentity>>

All full Dynamic Variable identities that apply to this FrooxEngine.Slot.

Remarks

This method uses slot.GetAvailableSpaces(),
which is different from a regular slot.GetComponentsInParents<FrooxEngine.DynamicVariableSpace>() call,
as it considers that FrooxEngine.DynamicVariableSpaces deeper in the hierarchy hide ones higher up with the same name.

GetAvailableVariableIdentitiesBySpace(Slot, string)

Gets all full Dynamic Variable identities that apply to this FrooxEngine.Slot, which match the given name.

public static IDictionary<DynamicVariableSpace, IEnumerable<DynamicVariableIdentity>> GetAvailableVariableIdentitiesBySpace(this Slot slot, string name)

Parameters

slot Slot

The FrooxEngine.Slot to find all applicable full Dynamic Variable identities for.

name string

The name that the variable identities must have.

Returns

IDictionary<DynamicVariableSpace, IEnumerable<DynamicVariableIdentity>>

All full Dynamic Variable identities that apply to this FrooxEngine.Slot that have the given name.

Remarks

This method uses slot.GetAvailableSpaces(),
which is different from a regular slot.GetComponentsInParents<FrooxEngine.DynamicVariableSpace>() call,
as it considers that FrooxEngine.DynamicVariableSpaces deeper in the hierarchy hide ones higher up with the same name.

GetAvailableVariableIdentitiesBySpace(Slot, Type)

Gets all full Dynamic Variable identities that apply to this FrooxEngine.Slot, which can be assigned a value of the given Type.

public static IDictionary<DynamicVariableSpace, IEnumerable<DynamicVariableIdentity>> GetAvailableVariableIdentitiesBySpace(this Slot slot, Type type)

Parameters

slot Slot

The FrooxEngine.Slot to find all applicable full Dynamic Variable identities for.

type Type

The type that must be assignable to the variables.

Returns

IDictionary<DynamicVariableSpace, IEnumerable<DynamicVariableIdentity>>

All full Dynamic Variable identities that apply to this FrooxEngine.Slot that the given Type can be assigned to.

Remarks

This method uses slot.GetAvailableSpaces(),
which is different from a regular slot.GetComponentsInParents<FrooxEngine.DynamicVariableSpace>() call,
as it considers that FrooxEngine.DynamicVariableSpaces deeper in the hierarchy hide ones higher up with the same name.

GetAvailableVariableIdentitiesBySpace<T>(Slot)

Gets all full Dynamic Variable identities that apply to this FrooxEngine.Slot, which can be assigned a value of type T.

public static IDictionary<DynamicVariableSpace, IEnumerable<DynamicVariableIdentity>> GetAvailableVariableIdentitiesBySpace<T>(this Slot slot)

Parameters

slot Slot

The FrooxEngine.Slot to find all applicable full Dynamic Variable identities for.

Returns

IDictionary<DynamicVariableSpace, IEnumerable<DynamicVariableIdentity>>

All full Dynamic Variable identities that apply to this FrooxEngine.Slot that T can be assigned to.

Type Parameters

T

The type that must be assignable to the variables.

Remarks

This method uses slot.GetAvailableSpaces(),
which is different from a regular slot.GetComponentsInParents<FrooxEngine.DynamicVariableSpace>() call,
as it considers that FrooxEngine.DynamicVariableSpaces deeper in the hierarchy hide ones higher up with the same name.

GetAvailableVariableIdentities<T>(Slot)

Gets all full Dynamic Variable identities that apply to this FrooxEngine.Slot, which can be assigned a value of type T.

public static IEnumerable<DynamicVariableIdentity> GetAvailableVariableIdentities<T>(this Slot slot)

Parameters

slot Slot

The FrooxEngine.Slot to find all applicable full Dynamic Variable identities for.

Returns

IEnumerable<DynamicVariableIdentity>

All full Dynamic Variable identities that apply to this FrooxEngine.Slot that T can be assigned to.

Type Parameters

T

The type that must be assignable to the variables.

Remarks

This method uses slot.GetAvailableSpaces(),
which is different from a regular slot.GetComponentsInParents<FrooxEngine.DynamicVariableSpace>() call,
as it considers that FrooxEngine.DynamicVariableSpaces deeper in the hierarchy hide ones higher up with the same name.

GetAvailableVariableIdentities<T>(Slot, string)

Gets all full Dynamic Variable identities that apply to this FrooxEngine.Slot, which can be assigned a value of type T and which match the given name.

public static IEnumerable<DynamicVariableIdentity> GetAvailableVariableIdentities<T>(this Slot slot, string name)

Parameters

slot Slot

The FrooxEngine.Slot to find all applicable full Dynamic Variable identities for.

name string

The name that the variable identities must have.

Returns

IEnumerable<DynamicVariableIdentity>

All full Dynamic Variable identities that apply to this FrooxEngine.Slot that T can be assigned to and that have the given name.

Type Parameters

T

The type that must be assignable to the variables.

Remarks

This method uses slot.GetAvailableSpaces(),
which is different from a regular slot.GetComponentsInParents<FrooxEngine.DynamicVariableSpace>() call,
as it considers that FrooxEngine.DynamicVariableSpaces deeper in the hierarchy hide ones higher up with the same name.

GetHandler<T>(IDynamicVariable<T>)

Gets the FrooxEngine.DynamicVariableHandler<T> of this dynamic variable.

public static DynamicVariableHandler<T> GetHandler<T>(this IDynamicVariable<T> dynamicVariable)

Parameters

dynamicVariable IDynamicVariable<T>

The dynamic variable of which to get the FrooxEngine.DynamicVariableHandler<T>.

Returns

DynamicVariableHandler<T>

The FrooxEngine.DynamicVariableHandler<T> of this dynamic variable.

Type Parameters

T

Exceptions

NullReferenceException

When the FrooxEngine.DynamicVariableHandler<T> of this dynamic variable could not be found.

GetIdentity(IDynamicVariable)

Gets the full Dynamic Variable identity of this dynamic variable component.

public static DynamicVariableIdentity GetIdentity(this IDynamicVariable variable)

Parameters

variable IDynamicVariable

The variable to get the full identity for.

Returns

DynamicVariableIdentity

The full identity of this dynamic variable.

Remarks

This requires this dynamic variable component to be linked to a FrooxEngine.DynamicVariableSpace.

Exceptions

NullReferenceException

When this dynamic variable isn't linked to a FrooxEngine.DynamicVariableSpace.

GetLinkedSpace(IDynamicVariable)

Gets the FrooxEngine.DynamicVariableSpace that this dynamic variable is linked to.

public static DynamicVariableSpace GetLinkedSpace(this IDynamicVariable dynamicVariable)

Parameters

dynamicVariable IDynamicVariable

The dynamic variable of which to get the linked FrooxEngine.DynamicVariableSpace.

Returns

DynamicVariableSpace

The FrooxEngine.DynamicVariableSpace that this dynamic variable is linked to.

Exceptions

NullReferenceException

When this dynamic variable is not linked to a FrooxEngine.DynamicVariableSpace or it could not be found.

GetLinkedVariables(DynamicVariableSpace, Predicate<IDynamicVariable>?, bool, bool, Predicate<Slot>?)

Gets all dynamic variable components linked to this FrooxEngine.DynamicVariableSpace that fulfill the given conditions.

public static IEnumerable<IDynamicVariable> GetLinkedVariables(this DynamicVariableSpace space, Predicate<IDynamicVariable>? filter = null, bool excludeDisabled = false, bool includeLocal = false, Predicate<Slot>? slotFilter = null)

Parameters

space DynamicVariableSpace

The dynamic variable space to get the linked variables of.

filter Predicate<IDynamicVariable>

A predicate to filter the linked variables returned; or null for all.

excludeDisabled bool

Whether to exclude disabled components from the results.

includeLocal bool

Whether to include local FrooxEngine.Slots in the search.

slotFilter Predicate<Slot>

A predicate to filter the FrooxEngine.Slots included in the search; or null for all.
The children of excluded FrooxEngine.Slots are excluded as well.

Returns

IEnumerable<IDynamicVariable>

The dynamic variable components linked to this FrooxEngine.DynamicVariableSpace that fulfill the given conditions.

GetLinkedVariables<T>(DynamicVariableSpace, Predicate<IDynamicVariable<T>>?, bool, bool, Predicate<Slot>?)

Gets all dynamic variable components linked to this FrooxEngine.DynamicVariableSpace that fulfill the given conditions.

public static IEnumerable<IDynamicVariable<T>> GetLinkedVariables<T>(this DynamicVariableSpace space, Predicate<IDynamicVariable<T>>? filter = null, bool excludeDisabled = false, bool includeLocal = false, Predicate<Slot>? slotFilter = null)

Parameters

space DynamicVariableSpace

The dynamic variable space to get the linked variables of.

filter Predicate<IDynamicVariable<T>>

A predicate to filter the linked variables returned; or null for all.

excludeDisabled bool

Whether to exclude disabled components from the results.

includeLocal bool

Whether to include local FrooxEngine.Slots in the search.

slotFilter Predicate<Slot>

A predicate to filter the FrooxEngine.Slots included in the search; or null for all.
The children of excluded FrooxEngine.Slots are excluded as well.

Returns

IEnumerable<IDynamicVariable<T>>

The dynamic variable components linked to this FrooxEngine.DynamicVariableSpace that fulfill the given conditions.

Type Parameters

T

The type of the values of the dynamic variables.

GetSyncWithVariable(SyncType, string, bool, bool)

Searches for a FrooxEngine.DynamicTypeField targetting this Type field and exposing it with the given variable name on the nearest Slot, or attaches one with the given parameters to it.

public static DynamicTypeField GetSyncWithVariable(this SyncType typeField, string variable, bool setupReset = false, bool forceCurrentValue = false)

Parameters

typeField SyncType

The Type field targetted by the FrooxEngine.DynamicTypeField.

variable string

The VariableName of the FrooxEngine.DynamicTypeField.

setupReset bool

Whether to also attach a FrooxEngine.DynamicValueVariableReset<T> with the current Type for load, paste, and duplicate.

forceCurrentValue bool

Whether to force the FrooxEngine.DynamicVariableSpace's Type for the variable to the references's current Type when attaching a FrooxEngine.DynamicTypeField.

Returns

DynamicTypeField

The found or attached FrooxEngine.DynamicTypeField.

GetSyncWithVariable<T>(IField<T>, string, bool, bool)

Searches for a FrooxEngine.DynamicField<T> targetting this field and exposing it with the given variable name on the nearest Slot, or attaches one with the given parameters to it.

public static DynamicField<T> GetSyncWithVariable<T>(this IField<T> field, string variable, bool setupReset = false, bool forceCurrentValue = false)

Parameters

field IField<T>

The field targetted by the FrooxEngine.DynamicField<T>.

variable string

The VariableName of the FrooxEngine.DynamicField<T>.

setupReset bool

Whether to also attach a FrooxEngine.DynamicValueVariableReset<T> with the current value for load, paste, and duplicate.

forceCurrentValue bool

Whether to force the FrooxEngine.DynamicVariableSpace's value for the variable to the field's current value when attaching a FrooxEngine.DynamicField<T>.

Returns

DynamicField<T>

The found or attached FrooxEngine.DynamicField<T>.

Type Parameters

T

The type of the field's value.

GetSyncWithVariable<T>(SyncRef<T>, string, bool, bool)

Searches for a FrooxEngine.DynamicReference<T> targetting this reference and exposing it with the given variable name on the nearest Slot, or attaches one with the given parameters to it.

public static DynamicReference<T> GetSyncWithVariable<T>(this SyncRef<T> reference, string variable, bool setupReset = false, bool forceCurrentValue = false) where T : class, IWorldElement

Parameters

reference SyncRef<T>

The reference targetted by the FrooxEngine.DynamicReference<T>.

variable string

The VariableName of the FrooxEngine.DynamicReference<T>.

setupReset bool

Whether to also attach a FrooxEngine.DynamicValueVariableReset<T> with the current target for load, paste, and duplicate.

forceCurrentValue bool

Whether to force the FrooxEngine.DynamicVariableSpace's target for the variable to the references's current target when attaching a FrooxEngine.DynamicReference<T>.

Returns

DynamicReference<T>

The found or attached FrooxEngine.DynamicReference<T>.

Type Parameters

T

The type of the reference's target.

GetVariableIdentities(DynamicVariableSpace)

Gets all full Dynamic Variable identities that are associated with this FrooxEngine.DynamicVariableSpace.

public static IEnumerable<DynamicVariableIdentity> GetVariableIdentities(this DynamicVariableSpace space)

Parameters

space DynamicVariableSpace

The FrooxEngine.DynamicVariableSpace to get all the variable identities of.

Returns

IEnumerable<DynamicVariableIdentity>

All full Dynamic Variable identities associated with this space.

GetVariableIdentities(DynamicVariableSpace, string)

Gets all full Dynamic Variable identities that are associated with this FrooxEngine.DynamicVariableSpace, which match the given name.

public static IEnumerable<DynamicVariableIdentity> GetVariableIdentities(this DynamicVariableSpace space, string name)

Parameters

space DynamicVariableSpace

The FrooxEngine.DynamicVariableSpace to get all the variable identities of.

name string

The name that the variable identities must have.

Returns

IEnumerable<DynamicVariableIdentity>

All full Dynamic Variable identities associated with this space that have the given name.

GetVariableIdentities(DynamicVariableSpace, Type)

Gets all full Dynamic Variable identities that are associated with this FrooxEngine.DynamicVariableSpace, which can be assigned a value of the given Type.

public static IEnumerable<DynamicVariableIdentity> GetVariableIdentities(this DynamicVariableSpace space, Type type)

Parameters

space DynamicVariableSpace

The FrooxEngine.DynamicVariableSpace to get all the variable identities of.

type Type

The type that must be assignable to the variables.

Returns

IEnumerable<DynamicVariableIdentity>

All full Dynamic Variable identities associated with this space that the given Type can be assigned to.

GetVariableIdentities<T>(DynamicVariableSpace)

Gets all full Dynamic Variable identities that are associated with this FrooxEngine.DynamicVariableSpace, which can be assigned a value of type T.

public static IEnumerable<DynamicVariableIdentity> GetVariableIdentities<T>(this DynamicVariableSpace space)

Parameters

space DynamicVariableSpace

The FrooxEngine.DynamicVariableSpace to get all the variable identities of.

Returns

IEnumerable<DynamicVariableIdentity>

All full Dynamic Variable identities associated with this space that T can be assigned to.

Type Parameters

T

The type that must be assignable to the variables.

GetVariableIdentity(DynamicVariableSpace, Type, string)

Gets a full Dynamic Variable identity that is associated with this FrooxEngine.DynamicVariableSpace and has the given type and name.

public static DynamicVariableIdentity GetVariableIdentity(this DynamicVariableSpace space, Type type, string name)

Parameters

space DynamicVariableSpace

The FrooxEngine.DynamicVariableSpace that the Dynamic Variable identity is a part of.

type Type

The Type of the Dynamic Variable identity.

name string

The name of the Dynamic Variable identity.

Returns

DynamicVariableIdentity

A full Dynamic Variable identity associated with this space that has the given type and name.

Remarks

Note: The Dynamic Variable identity created by this method does not necessarily exist on this FrooxEngine.DynamicVariableSpace.

GetVariableType(IDynamicVariable)

Gets the concrete type of the value of this dynamic variable.

public static Type GetVariableType(this IDynamicVariable dynamicVariable)

Parameters

dynamicVariable IDynamicVariable

The dynamic variable to get the concrete type of the value of.

Returns

Type

The concrete type of the value of this dynamic variable.

Remarks

This method assumes that this dynamic variable also implements FrooxEngine.IDynamicVariable<T>.
This should really always be the case.

IsLinkedToSpace(IDynamicVariable)

Determines whether this dynamic variable is linked against a FrooxEngine.DynamicVariableSpace.

public static bool IsLinkedToSpace(this IDynamicVariable dynamicVariable)

Parameters

dynamicVariable IDynamicVariable

The dynamic variable for which to check for a linked FrooxEngine.DynamicVariableSpace.

Returns

bool

true if this dynamic variable is linked to a FrooxEngine.DynamicVariableSpace; otherwise, false.

IsLinkedToSpace(IDynamicVariable, DynamicVariableSpace)

Determines whether this dynamic variable is linked against the given FrooxEngine.DynamicVariableSpace.

public static bool IsLinkedToSpace(this IDynamicVariable dynamicVariable, DynamicVariableSpace space)

Parameters

dynamicVariable IDynamicVariable

The dynamic variable for which to check the linked FrooxEngine.DynamicVariableSpace.

space DynamicVariableSpace

The dynamic variable space to compare to the linked one.

Returns

bool

true if this dynamic variable is linked to the given FrooxEngine.DynamicVariableSpace; otherwise, false.

IsLinkedToSpace(IDynamicVariable, ref DynamicVariableSpace)

Determines whether this dynamic variable is linked against the given FrooxEngine.DynamicVariableSpace and returns the space that it is actually linked to.

public static bool IsLinkedToSpace(this IDynamicVariable dynamicVariable, ref DynamicVariableSpace space)

Parameters

dynamicVariable IDynamicVariable

The dynamic variable for which to check the linked FrooxEngine.DynamicVariableSpace.

space DynamicVariableSpace

The dynamic variable space to compare to the linked one.
Will have the real space that the variable is linked to afterwards. This may be null if the variable isn't linked to a space.

Returns

bool

true if this dynamic variable is linked to the given FrooxEngine.DynamicVariableSpace; otherwise, false.

IsSharedConfigVariable(IDynamicVariable)

Determines whether this dynamic variable is part of the shared config.

public static bool IsSharedConfigVariable(this IDynamicVariable dynamicVariable)

Parameters

dynamicVariable IDynamicVariable

The dynamic variable to check.

Returns

bool

true if this dynamic variable is part of the shared config; otherwise, false.

IsSharedConfigVariable(DynamicVariableIdentity)

Determines whether this dynamic variable identity is part of the shared config.

public static bool IsSharedConfigVariable(this DynamicVariableIdentity identity)

Parameters

identity DynamicVariableIdentity

The dynamic variable identity to check.

Returns

bool

true if this dynamic variable identity is part of the shared config; otherwise, false.

IsValidName(string?)

Tests whether this string is a valid dynamic variable name.

public static bool IsValidName(this string? variableName)

Parameters

variableName string

The string to test.

Returns

bool

true if this string is a valid name; otherwise, false.

IsVariableOfCompatibleType(IDynamicVariable, Type)

Determines whether values of the given type can be assigned to this dynamic variable.

public static bool IsVariableOfCompatibleType(this IDynamicVariable dynamicVariable, Type valueType)

Parameters

dynamicVariable IDynamicVariable

The dynamic variable whose concrete type of the value to check.

valueType Type

The type of the values that should be assigned to this dynamic variable.

Returns

bool

true if values of the given type could be assigned to this dynamic variable; otherwise, false.

IsVariableOfCompatibleType<T>(IDynamicVariable)

Determines whether T values can be assigned to this dynamic variable.

public static bool IsVariableOfCompatibleType<T>(this IDynamicVariable dynamicVariable)

Parameters

dynamicVariable IDynamicVariable

The dynamic variable whose concrete type of the value to check.

Returns

bool

true if T values could be assigned to this dynamic variable; otherwise, false.

Type Parameters

T

The type of the values that should be assigned to this dynamic variable.

IsVariableOfType(IDynamicVariable, Type)

Determines whether the concrete type of the value of this dynamic variable is of the given type.

public static bool IsVariableOfType(this IDynamicVariable dynamicVariable, Type variableType)

Parameters

dynamicVariable IDynamicVariable

The dynamic variable whose concrete type of the value to check.

variableType Type

The type to compare the concrete type of the value of this dynamic variable against.

Returns

bool

true if the concrete type of the value of this dynamic variable is the given type; otherwise, false.

IsVariableOfType<T>(IDynamicVariable)

Determines whether the concrete type of the value of this dynamic variable is T.

public static bool IsVariableOfType<T>(this IDynamicVariable dynamicVariable)

Parameters

dynamicVariable IDynamicVariable

The dynamic variable whose concrete type of the value to check.

Returns

bool

true if the concrete type of the value of this dynamic variable is T; otherwise, false.

Type Parameters

T

The type to compare the concrete type of the value of this dynamic variable against.

ParseAsPath(string?, out string?, out string?)

Parses this string into processed dynamic variable space and path names, if possible.

public static void ParseAsPath(this string? path, out string? spaceName, out string? variableName)

Parameters

path string

The string to parse.

spaceName string

The parsed space name, or null if not applicable.

variableName string

The parsed variable name, or null if not applicable.

ProcessName(string?)

Processes this string to a trimmed and valid dynamic variable (space) name.

public static string? ProcessName(this string? variableName)

Parameters

variableName string

The string to process.

Returns

string

The trimmed name if valid; otherwise, null.

TryGetHandler<T>(IDynamicVariable<T>, out DynamicVariableHandler<T>?)

Tries to get the FrooxEngine.DynamicVariableHandler<T> of this dynamic variable.

public static bool TryGetHandler<T>(this IDynamicVariable<T> dynamicVariable, out DynamicVariableHandler<T>? handler)

Parameters

dynamicVariable IDynamicVariable<T>

The dynamic variable of which to get the FrooxEngine.DynamicVariableHandler<T>.

handler DynamicVariableHandler<T>

The FrooxEngine.DynamicVariableHandler<T> of this dynamic variable; otherwise, null.

Returns

bool

true if the FrooxEngine.DynamicVariableHandler<T> of this dynamic variable was found; otherwise, false.

Type Parameters

T

TryGetIdentity(IDynamicVariable, out DynamicVariableIdentity?)

Tries to get the full Dynamic Variable identity of this dynamic variable component.

public static bool TryGetIdentity(this IDynamicVariable variable, out DynamicVariableIdentity? identity)

Parameters

variable IDynamicVariable

The variable to get the full identity for.

identity DynamicVariableIdentity?

The resulting full identity if this variable is linked to a FrooxEngine.DynamicVariableSpace; otherwise, null.

Returns

bool

true if the full identity was successfully created; otherwise, false.

Remarks

This requires this dynamic variable component to be linked to a FrooxEngine.DynamicVariableSpace.

TryGetLinkedSpace(IDynamicVariable, out DynamicVariableSpace?)

Tries to get the FrooxEngine.DynamicVariableSpace that this dynamic variable is linked to.

public static bool TryGetLinkedSpace(this IDynamicVariable dynamicVariable, out DynamicVariableSpace? linkedSpace)

Parameters

dynamicVariable IDynamicVariable

The dynamic variable of which to get the linked FrooxEngine.DynamicVariableSpace.

linkedSpace DynamicVariableSpace

The FrooxEngine.DynamicVariableSpace that this dynamic variable is linked to was found; otherwise, null.

Returns

bool

true if this dynamic variable is linked to a FrooxEngine.DynamicVariableSpace; otherwise, false.

WithoutSharedConfigVariables(IEnumerable<IDynamicVariable>)

Excludes all dynamic variables from this sequence that are part of the shared config.

public static IEnumerable<IDynamicVariable> WithoutSharedConfigVariables(this IEnumerable<IDynamicVariable> dynamicVariables)

Parameters

dynamicVariables IEnumerable<IDynamicVariable>

The sequence to remove shared config variables from.

Returns

IEnumerable<IDynamicVariable>

The sequence without any shared config variables.

WithoutSharedConfigVariables(IEnumerable<DynamicVariableIdentity>)

Excludes all dynamic variables identities from this sequence that are part of the shared config.

public static IEnumerable<DynamicVariableIdentity> WithoutSharedConfigVariables(this IEnumerable<DynamicVariableIdentity> identities)

Parameters

identities IEnumerable<DynamicVariableIdentity>

The sequence to remove the identities of shared config variables from.

Returns

IEnumerable<DynamicVariableIdentity>

The sequence without any identities of shared config variables.