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
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
slotSlotThe slot to create the component on.
spaceNamestringThe name for the created space.
onlyDirectBindingboolWhether 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
slotSlotThe slot to create the component on.
spaceNamestringThe name for the created space.
onlyDirectBindingboolWhether 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
spaceDynamicVariableSpaceThe dynamic variable space to get the linked variables of.
predicateFunc<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
spaceDynamicVariableSpaceThe dynamic variable space to get the linked variables of.
identityDynamicVariableIdentityThe 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
spaceDynamicVariableSpaceThe dynamic variable space to get the linked variables of.
typeTypeThe type of the values of the dynamic variables.
namestringThe name of the dynamic variables.
Returns
- IEnumerable<IDynamicVariable>
All dynamic variable components linked to this FrooxEngine.DynamicVariableSpace that have the given
typeandname.
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
spaceDynamicVariableSpaceThe dynamic variable space to get the linked variables of.
namestringThe name of the dynamic variables.
Returns
- IEnumerable<IDynamicVariable<T>>
All dynamic variable components linked to this FrooxEngine.DynamicVariableSpace that have the given
typeandname.
Type Parameters
TThe 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
spaceDynamicVariableSpaceThe dynamic variable space to get the linked variables of.
predicateFunc<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
TThe 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
slotSlotThe FrooxEngine.Slot to find all applicable FrooxEngine.DynamicVariableSpaces for.
filterPredicate<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
slotSlotThe 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
slotSlotThe FrooxEngine.Slot to find all applicable full Dynamic Variable identities for.
namestringThe 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
slotSlotThe FrooxEngine.Slot to find all applicable full Dynamic Variable identities for.
typeTypeThe 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
slotSlotThe FrooxEngine.Slot to find all applicable full Dynamic Variable identities for.
typeTypeThe type that must be assignable to the variables.
namestringThe 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
slotSlotThe 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
slotSlotThe FrooxEngine.Slot to find all applicable full Dynamic Variable identities for.
namestringThe 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
slotSlotThe FrooxEngine.Slot to find all applicable full Dynamic Variable identities for.
typeTypeThe 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
slotSlotThe 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
Tcan be assigned to.
Type Parameters
TThe 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
slotSlotThe 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
Tcan be assigned to.
Type Parameters
TThe 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
slotSlotThe FrooxEngine.Slot to find all applicable full Dynamic Variable identities for.
namestringThe name that the variable identities must have.
Returns
- IEnumerable<DynamicVariableIdentity>
All full Dynamic Variable identities that apply to this FrooxEngine.Slot that
Tcan be assigned to and that have the givenname.
Type Parameters
TThe 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
dynamicVariableIDynamicVariable<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
variableIDynamicVariableThe 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
dynamicVariableIDynamicVariableThe 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
spaceDynamicVariableSpaceThe dynamic variable space to get the linked variables of.
filterPredicate<IDynamicVariable>A predicate to filter the linked variables returned; or
nullfor all.excludeDisabledboolWhether to exclude disabled components from the results.
includeLocalboolWhether to include local FrooxEngine.Slots in the search.
slotFilterPredicate<Slot>A predicate to filter the FrooxEngine.Slots included in the search; or
nullfor 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
spaceDynamicVariableSpaceThe dynamic variable space to get the linked variables of.
filterPredicate<IDynamicVariable<T>>A predicate to filter the linked variables returned; or
nullfor all.excludeDisabledboolWhether to exclude disabled components from the results.
includeLocalboolWhether to include local FrooxEngine.Slots in the search.
slotFilterPredicate<Slot>A predicate to filter the FrooxEngine.Slots included in the search; or
nullfor 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
TThe 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
typeFieldSyncTypeThe Type field targetted by the FrooxEngine.DynamicTypeField.
variablestringThe VariableName of the FrooxEngine.DynamicTypeField.
setupResetboolWhether to also attach a FrooxEngine.DynamicValueVariableReset<T> with the current Type for load, paste, and duplicate.
forceCurrentValueboolWhether 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
fieldIField<T>The field targetted by the FrooxEngine.DynamicField<T>.
variablestringThe VariableName of the FrooxEngine.DynamicField<T>.
setupResetboolWhether to also attach a FrooxEngine.DynamicValueVariableReset<T> with the current value for load, paste, and duplicate.
forceCurrentValueboolWhether 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
TThe 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
referenceSyncRef<T>The reference targetted by the FrooxEngine.DynamicReference<T>.
variablestringThe VariableName of the FrooxEngine.DynamicReference<T>.
setupResetboolWhether to also attach a FrooxEngine.DynamicValueVariableReset<T> with the current target for load, paste, and duplicate.
forceCurrentValueboolWhether 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
TThe 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
spaceDynamicVariableSpaceThe 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
spaceDynamicVariableSpaceThe FrooxEngine.DynamicVariableSpace to get all the variable identities of.
namestringThe name that the variable identities must have.
Returns
- IEnumerable<DynamicVariableIdentity>
All full Dynamic Variable identities associated with this
spacethat have the givenname.
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
spaceDynamicVariableSpaceThe FrooxEngine.DynamicVariableSpace to get all the variable identities of.
typeTypeThe type that must be assignable to the variables.
Returns
- IEnumerable<DynamicVariableIdentity>
All full Dynamic Variable identities associated with this
spacethat 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
spaceDynamicVariableSpaceThe FrooxEngine.DynamicVariableSpace to get all the variable identities of.
Returns
- IEnumerable<DynamicVariableIdentity>
All full Dynamic Variable identities associated with this
spacethatTcan be assigned to.
Type Parameters
TThe 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
spaceDynamicVariableSpaceThe FrooxEngine.DynamicVariableSpace that the Dynamic Variable identity is a part of.
typeTypeThe Type of the Dynamic Variable identity.
namestringThe name of the Dynamic Variable identity.
Returns
- DynamicVariableIdentity
A full Dynamic Variable identity associated with this
spacethat has the giventypeandname.
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
dynamicVariableIDynamicVariableThe 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
dynamicVariableIDynamicVariableThe dynamic variable for which to check for a linked FrooxEngine.DynamicVariableSpace.
Returns
- bool
trueif 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
dynamicVariableIDynamicVariableThe dynamic variable for which to check the linked FrooxEngine.DynamicVariableSpace.
spaceDynamicVariableSpaceThe dynamic variable space to compare to the linked one.
Returns
- bool
trueif 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
dynamicVariableIDynamicVariableThe dynamic variable for which to check the linked FrooxEngine.DynamicVariableSpace.
spaceDynamicVariableSpaceThe 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
trueif 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
dynamicVariableIDynamicVariableThe 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
identityDynamicVariableIdentityThe 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
variableNamestringThe string to test.
Returns
- bool
trueif 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
dynamicVariableIDynamicVariableThe dynamic variable whose concrete type of the value to check.
valueTypeTypeThe type of the values that should be assigned to this dynamic variable.
Returns
IsVariableOfCompatibleType<T>(IDynamicVariable)
Determines whether T values can be assigned to this dynamic variable.
public static bool IsVariableOfCompatibleType<T>(this IDynamicVariable dynamicVariable)
Parameters
dynamicVariableIDynamicVariableThe dynamic variable whose concrete type of the value to check.
Returns
Type Parameters
TThe 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
dynamicVariableIDynamicVariableThe dynamic variable whose concrete type of the value to check.
variableTypeTypeThe 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
dynamicVariableIDynamicVariableThe dynamic variable whose concrete type of the value to check.
Returns
Type Parameters
TThe type to compare the concrete type of the value of this dynamic variable against.
ParseAsPath(string?, out string?, out string?)
public static void ParseAsPath(this string? path, out string? spaceName, out string? variableName)
Parameters
pathstringThe string to parse.
spaceNamestringThe parsed space name, or
nullif not applicable.variableNamestringThe parsed variable name, or
nullif not applicable.
ProcessName(string?)
public static string? ProcessName(this string? variableName)
Parameters
variableNamestringThe string to process.
Returns
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
dynamicVariableIDynamicVariable<T>The dynamic variable of which to get the FrooxEngine.DynamicVariableHandler<T>.
handlerDynamicVariableHandler<T>The FrooxEngine.DynamicVariableHandler<T> of this dynamic variable; otherwise,
null.
Returns
- bool
trueif 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
variableIDynamicVariableThe variable to get the full identity for.
identityDynamicVariableIdentity?The resulting full identity if this variable is linked to a FrooxEngine.DynamicVariableSpace; otherwise, null.
Returns
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
dynamicVariableIDynamicVariableThe dynamic variable of which to get the linked FrooxEngine.DynamicVariableSpace.
linkedSpaceDynamicVariableSpaceThe FrooxEngine.DynamicVariableSpace that this dynamic variable is linked to was found; otherwise,
null.
Returns
- bool
trueif 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
dynamicVariablesIEnumerable<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
identitiesIEnumerable<DynamicVariableIdentity>The sequence to remove the identities of shared config variables from.
Returns
- IEnumerable<DynamicVariableIdentity>
The sequence without any identities of shared config variables.