Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
ShaderMixinGeneratorSource.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;
4 using SiliconStudio.Core;
5 
6 namespace SiliconStudio.Paradox.Shaders
7 {
8  /// <summary>
9  /// A shader source that is linked to a pdxfx effect.
10  /// </summary>
11  [DataContract]
12  public sealed class ShaderMixinGeneratorSource : ShaderSource, IEquatable<ShaderMixinGeneratorSource>
13  {
14  private string name;
15 
16  /// <summary>
17  /// Initializes a new instance of the <see cref="ShaderMixinGeneratorSource"/> class.
18  /// </summary>
20  {
21  }
22 
23  /// <summary>
24  /// Initializes a new instance of the <see cref="ShaderMixinGeneratorSource"/> class.
25  /// </summary>
26  /// <param name="name">The name of the pdxfx effect.</param>
27  public ShaderMixinGeneratorSource(string name)
28  {
29  this.name = name;
30  }
31 
32  /// <summary>
33  /// Gets or sets the name of the pdxfx effect.
34  /// </summary>
35  /// <value>The name of the pdxfx effect.</value>
36  public string Name
37  {
38  get
39  {
40  return name;
41  }
42  set
43  {
44  name = value;
45  }
46  }
47 
48  /// <summary>
49  /// Indicates whether the current object is equal to another object of the same type.
50  /// </summary>
51  /// <param name="other">An object to compare with this object.</param>
52  /// <returns>true if the current object is equal to the <paramref name="other" /> parameter; otherwise, false.</returns>
54  {
55  if (ReferenceEquals(null, other)) return false;
56  if (ReferenceEquals(this, other)) return true;
57  return string.Equals(name, other.name);
58  }
59 
60  public override object Clone()
61  {
62  return new ShaderMixinGeneratorSource(name);
63  }
64 
65  public override bool Equals(object obj)
66  {
67  if (ReferenceEquals(null, obj)) return false;
68  if (ReferenceEquals(this, obj)) return true;
69  return obj is ShaderMixinGeneratorSource && Equals((ShaderMixinGeneratorSource)obj);
70  }
71 
72  public override int GetHashCode()
73  {
74  return (name != null ? name.GetHashCode() : 0);
75  }
76 
77  public static bool operator ==(ShaderMixinGeneratorSource left, ShaderMixinGeneratorSource right)
78  {
79  return Equals(left, right);
80  }
81 
82  public static bool operator !=(ShaderMixinGeneratorSource left, ShaderMixinGeneratorSource right)
83  {
84  return !Equals(left, right);
85  }
86 
87  public override string ToString()
88  {
89  return string.Format("pdxfx {0}", Name);
90  }
91  }
92 }
A shader source that is linked to a pdxfx effect.
bool Equals(ShaderMixinGeneratorSource other)
Indicates whether the current object is equal to another object of the same type. ...
override bool Equals(object obj)
Determines whether the specified System.Object is equal to this instance.
ShaderMixinGeneratorSource(string name)
Initializes a new instance of the ShaderMixinGeneratorSource class.
ShaderMixinGeneratorSource()
Initializes a new instance of the ShaderMixinGeneratorSource class.