Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
ParticleFieldDescription.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 namespace SiliconStudio.Paradox.Particles
4 {
5  /// <summary>
6  /// Describes a field for a particle, which can store specific data for every particle.
7  /// </summary>
9  {
10  private readonly int hashCode;
11  private readonly string name;
12 
13  protected ParticleFieldDescription(string name)
14  {
15  this.hashCode = name.GetHashCode();
16  this.name = name;
17  }
18 
19  public string Name
20  {
21  get { return name; }
22  }
23 
24  public override int GetHashCode()
25  {
26  return hashCode;
27  }
28  }
29 
30  /// <summary>
31  /// Describes a field for a particle, which can store specific data for every particle.
32  /// </summary>
34  {
35  private readonly T defaultValue;
36 
37  public T DefaultValue
38  {
39  get { return defaultValue; }
40  }
41 
42  public ParticleFieldDescription(string name)
43  : base(name)
44  {
45  }
46 
47  public ParticleFieldDescription(string name, T defaultValue)
48  : this(name)
49  {
50  this.defaultValue = defaultValue;
51  }
52  }
53 }
Describes a field for a particle, which can store specific data for every particle.