Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
EffectParameterValuesGenerator.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 using System.Collections.Generic;
4 using System.Linq;
5 
6 using SiliconStudio.Core;
7 using SiliconStudio.Paradox.Effects;
8 
9 namespace SiliconStudio.Paradox.Assets.Effect.ValueGenerators
10 {
11  /// <summary>
12  /// A generator that contains only values.
13  /// </summary>
14  [DataContract]
15  public class EffectParameterValuesGenerator<T> : List<T>, IEffectParameterValueGenerator
16  {
17  IEnumerable<object> IEffectParameterValueGenerator.GenerateValues(ParameterKey key)
18  {
19  return this.Select(value => key.ConvertValue(value));
20  }
21 
22  void IEffectParameterValueGenerator.AddValue(ParameterKey key, object value)
23  {
24  this.Add((T)key.ConvertValue(value));
25  }
26  }
27 }
Key of an effect parameter.
Definition: ParameterKey.cs:15