Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
SiliconStudio.Paradox.Effects.ParameterCollection Class Reference

A container to handle a hierarchical collection of effect variables. More...

Inheritance diagram for SiliconStudio.Paradox.Effects.ParameterCollection:
IDictionary< ParameterKey, object > SiliconStudio.Paradox.Shaders.Compiler.CompilerParameters SiliconStudio.Paradox.Shaders.ShaderMixinParameters BasicShaders.BasicShadersParameters DefaultEffects.LightingParameters PostEffects.PostEffectsParameters SiliconStudio.Paradox.Effects.LightingKeys SiliconStudio.Paradox.Effects.RenderingParameters SiliconStudio.Paradox.Effects.ShadowMapParameters

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)
 
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)
 
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< ParameterKeyKeys [get]
 Gets the keys of this collection. More...
 
ICollection< object > Values [get, set]
 
object this[ParameterKey key] [get, set]
 

Detailed Description

A container to handle a hierarchical collection of effect variables.

Definition at line 28 of file ParameterCollection.cs.

Constructor & Destructor Documentation

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.

Parameters
nameThe name.

Definition at line 59 of file ParameterCollection.cs.

Member Function Documentation

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,
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.

Parameters
keyKey to listen to (or null to listen to everything).
valueUpdatedDelegate 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.

Parameters
parameterCollectionsThe 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
parametersThe collection of parameters that should be included in this one.
Returns
True if this collection contains all values from parameters. False otherwise.

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.

Parameters
keyThe parameter key.
Returns
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().

void SiliconStudio.Paradox.Effects.ParameterCollection.Destroy ( )
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.

Template Parameters
TA valuetype
Parameters
keyThe key.
Returns
The value for the specified 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.

Template Parameters
TA valuetype
Parameters
keyThe key.
resultThe 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.

bool SiliconStudio.Paradox.Effects.ParameterCollection.GetKeyIndex ( ParameterKey  key,
out int  index 
)
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.

int SiliconStudio.Paradox.Effects.ParameterCollection.GetOrCreateKeyIndex ( ParameterKey  key)
protected

Gets or creates an internal value index given its key.

Parameters
key
Returns

Definition at line 395 of file ParameterCollection.cs.

int SiliconStudio.Paradox.Effects.ParameterCollection.InternalValueBinarySearch ( ParameterKey  key)
protected

Gets the index of an InternalValue within internalValues given its key.

Parameters
key
Returns

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].

Parameters
keyThe key.
Returns
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

Parameters
keyThe key.
Exceptions
InvalidOperationExceptionIf 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.

Parameters
parameterCollectionThe 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.

Parameters
keyThe key.

Definition at line 809 of file ParameterCollection.cs.

void SiliconStudio.Paradox.Effects.ParameterCollection.Set< T > ( ParameterKey< T >  key,
value 
)

Sets a struct value for the specified key.

Template Parameters
TA valuetype
Parameters
keyThe key.
valueThe 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.

Template Parameters
TA valuetype
Parameters
keyThe key.
valuesThe array of valuetypes.
destinationOffsetThe destination offset.
countThe number of elements to copy from value array.
Type Constraints
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.

Template Parameters
TA valuetype
Parameters
keyThe key.
valuesThe array of valuetypes.
sourceOffsetThe source offset.
destinationOffsetThe destination offset.
countThe number of elements to copy from value array.
Type Constraints
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.

Template Parameters
TA valuetype
Parameters
keyThe key.
valuesThe array of valuetypes.
Type Constraints
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).

Parameters
keyThe key.
overrideIfInheritedSpecifies 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.

Template Parameters
T
Parameters
keyThe key.
Returns

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.

Template Parameters
T
Parameters
keyThe key.
resultThe result.
Returns

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 
)

Property Documentation

int SiliconStudio.Paradox.Effects.ParameterCollection.Count
get

Gets the number of parameters stored in this instance..

Definition at line 145 of file ParameterCollection.cs.

IEnumerable<ParameterDynamicValue> SiliconStudio.Paradox.Effects.ParameterCollection.DynamicValues
get

Gets the dynamic values.

Definition at line 87 of file ParameterCollection.cs.

bool SiliconStudio.Paradox.Effects.ParameterCollection.IsReadOnly
getset

Definition at line 149 of file ParameterCollection.cs.

IEnumerable<ParameterKey> SiliconStudio.Paradox.Effects.ParameterCollection.Keys
get

Gets the keys of this collection.

Definition at line 155 of file ParameterCollection.cs.

string SiliconStudio.Paradox.Effects.ParameterCollection.Name
getset

Definition at line 73 of file ParameterCollection.cs.

IParameterCollectionInheritance [] SiliconStudio.Paradox.Effects.ParameterCollection.Sources
get

Gets the sources for this collection.

Definition at line 79 of file ParameterCollection.cs.

object SiliconStudio.Paradox.Effects.ParameterCollection.this[ParameterKey key]
getset

Definition at line 277 of file ParameterCollection.cs.

ICollection<object> SiliconStudio.Paradox.Effects.ParameterCollection.Values
getset

Definition at line 159 of file ParameterCollection.cs.


The documentation for this class was generated from the following file: