![]() |
Paradox Game Engine
v1.0.0 beta06
|
A container to handle a hierarchical collection of effect variables. More...
Classes | |
class | InternalValue |
Holds a value inside ParameterCollection. More... | |
class | InternalValue< T > |
class | InternalValueArray< T > |
class | InternalValueBase< T > |
Holds a value of a specific type in a ParameterCollection. | |
struct | InternalValueReference |
Dynamic values use this class when pointing to a source. | |
Public Member Functions | |
ParameterCollection () | |
Initializes a new instance of the ParameterCollection class. More... | |
ParameterCollection (string name) | |
Initializes a new instance of the ParameterCollection class. More... | |
delegate void | ValueChangedDelegate (ParameterKey key, InternalValue internalValue, object oldValue) |
void | Clear () |
void | AddEvent (ParameterKey key, ValueChangedDelegate valueUpdated) |
Adds an event that will be raised when a value is updated. More... | |
bool | ContainsKey (ParameterKey key) |
Determines whether the specified instance contains a parameter key. More... | |
void | Add (ParameterKey key, object value) |
bool | TryGetValue (ParameterKey key, out object value) |
IEnumerator< KeyValuePair < ParameterKey, object > > | GetEnumerator () |
override string | ToString () |
string | ToStringDetailed (string itemSeparator="\r\n", string itemTab=" ") |
void | Add< T > (ParameterKey< T > key, T value) |
T | Get< T > (ParameterKey< T > key) |
Gets the value for the specified key. More... | |
void | Get< T > (ParameterKey< T > key, out T result) |
Gets the value for the specified key. More... | |
object | GetObject (ParameterKey key) |
T | TryGet< T > (ParameterKey< T > key) |
Tries to get the value for the specified key. More... | |
bool | TryGet< T > (ParameterKey< T > key, out T result) |
Tries to get the value for the specified key. More... | |
void | AddDynamic< T > (ParameterKey< T > key, ParameterDynamicValue< T > dynamicValue) |
void | SetDefault (ParameterKey key, bool overrideIfInherited=false) |
Sets the default value for the specified key (if undefined, otherwise do nothing). More... | |
void | Set< T > (ParameterKey< T > key, T value) |
Sets a struct value for the specified key. More... | |
void | SetArray< T > (ParameterKey< T[]> key, T[] values) |
Sets an array of valuetypes for the specified key. More... | |
void | Set< T > (ParameterKey< T[]> key, T[] values, int destinationOffset, int count) |
Sets an array of valuetypes for the specified key. More... | |
void | Set< T > (ParameterKey< T[]> key, T[] values, int sourceOffset, int destinationOffset, int count) |
Sets an array of valuetypes for the specified key. More... | |
void | SetObject (ParameterKey key, object resourceValue) |
void | Remove (ParameterKey key) |
Removes the specified key and associated value More... | |
bool | Contains (ParameterCollection parameters) |
Tests if the values in parameters are contained into this instance. It will automatically handle default values as well (that is, if something is set in parameters with default value but not set in this instance, it will be ignored). More... | |
void | AddSources (params IParameterCollectionInheritance[] newSources) |
Adds the sources. More... | |
bool | RemoveSource (IParameterCollectionInheritance removedInheritance) |
Removes the sources. More... | |
void | Reset (ParameterKey key) |
Removes the value locally and try to get a value from a source. More... | |
bool | IsValueOwner (InternalValue internalValue) |
Determines whether [is value owner] of [the specified key]. More... | |
Protected Member Functions | |
bool | GetKeyIndex (ParameterKey key, out int index) |
int | InternalValueBinarySearch (ParameterKey key) |
Gets the index of an InternalValue within internalValues given its key. More... | |
int | GetOrCreateKeyIndex (ParameterKey key) |
Gets or creates an internal value index given its key. More... | |
void | Destroy () |
Properties | |
string | Name [get, set] |
IParameterCollectionInheritance[] | Sources [get] |
Gets the sources for this collection. More... | |
IEnumerable < ParameterDynamicValue > | DynamicValues [get] |
Gets the dynamic values. More... | |
int | Count [get] |
Gets the number of parameters stored in this instance.. More... | |
bool | IsReadOnly [get, set] |
IEnumerable< ParameterKey > | Keys [get] |
Gets the keys of this collection. More... | |
ICollection< object > | Values [get, set] |
object | this[ParameterKey key] [get, set] |
A container to handle a hierarchical collection of effect variables.
Definition at line 28 of file ParameterCollection.cs.
SiliconStudio.Paradox.Effects.ParameterCollection.ParameterCollection | ( | ) |
Initializes a new instance of the ParameterCollection class.
Definition at line 51 of file ParameterCollection.cs.
SiliconStudio.Paradox.Effects.ParameterCollection.ParameterCollection | ( | string | name | ) |
Initializes a new instance of the ParameterCollection class.
name | The name. |
Definition at line 59 of file ParameterCollection.cs.
void SiliconStudio.Paradox.Effects.ParameterCollection.Add | ( | ParameterKey | key, |
object | value | ||
) |
Definition at line 249 of file ParameterCollection.cs.
void SiliconStudio.Paradox.Effects.ParameterCollection.Add< T > | ( | ParameterKey< T > | key, |
T | value | ||
) |
Definition at line 328 of file ParameterCollection.cs.
void SiliconStudio.Paradox.Effects.ParameterCollection.AddDynamic< T > | ( | ParameterKey< T > | key, |
ParameterDynamicValue< T > | dynamicValue | ||
) |
Definition at line 499 of file ParameterCollection.cs.
void SiliconStudio.Paradox.Effects.ParameterCollection.AddEvent | ( | ParameterKey | key, |
ValueChangedDelegate | valueUpdated | ||
) |
Adds an event that will be raised when a value is updated.
key | Key to listen to (or null to listen to everything). |
valueUpdated | Delegate that will be called when value changes. |
Definition at line 182 of file ParameterCollection.cs.
void SiliconStudio.Paradox.Effects.ParameterCollection.AddSources | ( | params IParameterCollectionInheritance[] | newSources | ) |
Adds the sources.
parameterCollections | The effect variable collections. |
Definition at line 714 of file ParameterCollection.cs.
void SiliconStudio.Paradox.Effects.ParameterCollection.Clear | ( | ) |
Definition at line 113 of file ParameterCollection.cs.
bool SiliconStudio.Paradox.Effects.ParameterCollection.Contains | ( | ParameterCollection | parameters | ) |
Tests if the values in parameters are contained into this instance. It will automatically handle default values as well (that is, if something is set in parameters with default value but not set in this instance, it will be ignored).
parameters | The collection of parameters that should be included in this one. |
Definition at line 689 of file ParameterCollection.cs.
Referenced by SiliconStudio.Paradox.Shaders.Compiler.EffectCompilerBase.GetShaderFromParameters().
bool SiliconStudio.Paradox.Effects.ParameterCollection.ContainsKey | ( | ParameterKey | key | ) |
Determines whether the specified instance contains a parameter key.
key | The parameter key. |
true
if the specified key contains this key; otherwise, false
. Definition at line 243 of file ParameterCollection.cs.
Referenced by SiliconStudio.Paradox.Effects.EffectParameterExtensions.RegisterParameter().
|
protected |
Definition at line 850 of file ParameterCollection.cs.
T SiliconStudio.Paradox.Effects.ParameterCollection.Get< T > | ( | ParameterKey< T > | key | ) |
Gets the value for the specified key.
T | A valuetype |
key | The key. |
Definition at line 417 of file ParameterCollection.cs.
void SiliconStudio.Paradox.Effects.ParameterCollection.Get< T > | ( | ParameterKey< T > | key, |
out T | result | ||
) |
Gets the value for the specified key.
T | A valuetype |
key | The key. |
result | The result. |
Definition at line 430 of file ParameterCollection.cs.
IEnumerator<KeyValuePair<ParameterKey, object> > SiliconStudio.Paradox.Effects.ParameterCollection.GetEnumerator | ( | ) |
Definition at line 301 of file ParameterCollection.cs.
|
protected |
Definition at line 344 of file ParameterCollection.cs.
object SiliconStudio.Paradox.Effects.ParameterCollection.GetObject | ( | ParameterKey | key | ) |
Definition at line 444 of file ParameterCollection.cs.
|
protected |
Gets or creates an internal value index given its key.
key |
Definition at line 395 of file ParameterCollection.cs.
|
protected |
Gets the index of an InternalValue within internalValues given its key.
key |
Definition at line 364 of file ParameterCollection.cs.
bool SiliconStudio.Paradox.Effects.ParameterCollection.IsValueOwner | ( | InternalValue | internalValue | ) |
Determines whether [is value owner] of [the specified key].
key | The key. |
true
if [is value owner] of [the specified key]; otherwise, false
. Definition at line 842 of file ParameterCollection.cs.
void SiliconStudio.Paradox.Effects.ParameterCollection.Remove | ( | ParameterKey | key | ) |
Removes the specified key and associated value
key | The key. |
InvalidOperationException | If trying to remove a key from a collection that is not the owner. Or trying to remove a key that is referenced by a dynamic key |
Definition at line 663 of file ParameterCollection.cs.
bool SiliconStudio.Paradox.Effects.ParameterCollection.RemoveSource | ( | IParameterCollectionInheritance | removedInheritance | ) |
Removes the sources.
parameterCollection | The source parameter collection. |
Definition at line 767 of file ParameterCollection.cs.
void SiliconStudio.Paradox.Effects.ParameterCollection.Reset | ( | ParameterKey | key | ) |
Removes the value locally and try to get a value from a source.
key | The key. |
Definition at line 809 of file ParameterCollection.cs.
void SiliconStudio.Paradox.Effects.ParameterCollection.Set< T > | ( | ParameterKey< T > | key, |
T | value | ||
) |
Sets a struct value for the specified key.
T | A valuetype |
key | The key. |
value | The value. |
Definition at line 536 of file ParameterCollection.cs.
void SiliconStudio.Paradox.Effects.ParameterCollection.Set< T > | ( | ParameterKey< T[]> | key, |
T[] | values, | ||
int | destinationOffset, | ||
int | count | ||
) |
Sets an array of valuetypes for the specified key.
T | A valuetype |
key | The key. |
values | The array of valuetypes. |
destinationOffset | The destination offset. |
count | The number of elements to copy from value array. |
T | : | struct |
Definition at line 574 of file ParameterCollection.cs.
References DirectX.count.
void SiliconStudio.Paradox.Effects.ParameterCollection.Set< T > | ( | ParameterKey< T[]> | key, |
T[] | values, | ||
int | sourceOffset, | ||
int | destinationOffset, | ||
int | count | ||
) |
Sets an array of valuetypes for the specified key.
T | A valuetype |
key | The key. |
values | The array of valuetypes. |
sourceOffset | The source offset. |
destinationOffset | The destination offset. |
count | The number of elements to copy from value array. |
T | : | struct |
Definition at line 611 of file ParameterCollection.cs.
References DirectX.count.
void SiliconStudio.Paradox.Effects.ParameterCollection.SetArray< T > | ( | ParameterKey< T[]> | key, |
T[] | values | ||
) |
Sets an array of valuetypes for the specified key.
T | A valuetype |
key | The key. |
values | The array of valuetypes. |
T | : | struct |
Definition at line 561 of file ParameterCollection.cs.
References SiliconStudio.Paradox.Effects.ParameterKey.Length.
void SiliconStudio.Paradox.Effects.ParameterCollection.SetDefault | ( | ParameterKey | key, |
bool | overrideIfInherited = false |
||
) |
Sets the default value for the specified key (if undefined, otherwise do nothing).
key | The key. |
overrideIfInherited | Specifies if inherited value should be overriden. |
Definition at line 516 of file ParameterCollection.cs.
void SiliconStudio.Paradox.Effects.ParameterCollection.SetObject | ( | ParameterKey | key, |
object | resourceValue | ||
) |
Definition at line 639 of file ParameterCollection.cs.
override string SiliconStudio.Paradox.Effects.ParameterCollection.ToString | ( | ) |
Definition at line 307 of file ParameterCollection.cs.
string SiliconStudio.Paradox.Effects.ParameterCollection.ToStringDetailed | ( | string | itemSeparator = "\r\n" , |
string | itemTab = " " |
||
) |
Definition at line 312 of file ParameterCollection.cs.
T SiliconStudio.Paradox.Effects.ParameterCollection.TryGet< T > | ( | ParameterKey< T > | key | ) |
Tries to get the value for the specified key.
T |
key | The key. |
Definition at line 470 of file ParameterCollection.cs.
bool SiliconStudio.Paradox.Effects.ParameterCollection.TryGet< T > | ( | ParameterKey< T > | key, |
out T | result | ||
) |
Tries to get the value for the specified key.
T |
key | The key. |
result | The result. |
Definition at line 484 of file ParameterCollection.cs.
bool SiliconStudio.Paradox.Effects.ParameterCollection.TryGetValue | ( | ParameterKey | key, |
out object | value | ||
) |
Definition at line 259 of file ParameterCollection.cs.
delegate void SiliconStudio.Paradox.Effects.ParameterCollection.ValueChangedDelegate | ( | ParameterKey | key, |
InternalValue | internalValue, | ||
object | oldValue | ||
) |
|
get |
Gets the number of parameters stored in this instance..
Definition at line 145 of file ParameterCollection.cs.
|
get |
Gets the dynamic values.
Definition at line 87 of file ParameterCollection.cs.
|
getset |
Definition at line 149 of file ParameterCollection.cs.
|
get |
Gets the keys of this collection.
Definition at line 155 of file ParameterCollection.cs.
|
getset |
Definition at line 73 of file ParameterCollection.cs.
|
get |
Gets the sources for this collection.
Definition at line 79 of file ParameterCollection.cs.
|
getset |
Definition at line 277 of file ParameterCollection.cs.
|
getset |
Definition at line 159 of file ParameterCollection.cs.