Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
HashSourceCollection.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 System.Collections.Generic;
5 using SiliconStudio.Core;
6 using SiliconStudio.Core.Serialization;
7 using SiliconStudio.Core.Storage;
8 
9 namespace SiliconStudio.Paradox.Shaders
10 {
11  /// <summary>
12  /// A dictionary of associations betweens asset shader urls and <see cref="ObjectId"/>
13  /// </summary>
14  [DataContract]
15  public class HashSourceCollection : Dictionary<string, ObjectId>, IEquatable<HashSourceCollection>
16  {
17  /// <summary>
18  /// Initializes a new instance of the <see cref="HashSourceCollection"/> class.
19  /// </summary>
21  {
22  }
23 
24  /// <summary>
25  /// Indicates whether the current object is equal to another object of the same type.
26  /// </summary>
27  /// <param name="other">An object to compare with this object.</param>
28  /// <returns>true if the current object is equal to the <paramref name="other" /> parameter; otherwise, false.</returns>
29  public bool Equals(HashSourceCollection other)
30  {
31  if (ReferenceEquals(null, other)) return false;
32  if (ReferenceEquals(this, other)) return true;
33 
34  return Utilities.Compare<string, ObjectId>(this, other);
35  }
36 
37  public override bool Equals(object obj)
38  {
39  if (ReferenceEquals(null, obj)) return false;
40  if (ReferenceEquals(this, obj)) return true;
41  if (obj.GetType() != this.GetType()) return false;
42  return Equals((HashSourceCollection)obj);
43  }
44 
45  public override int GetHashCode()
46  {
47  return Utilities.GetHashCode(this);
48  }
49  }
50 }
A dictionary of associations betweens asset shader urls and ObjectId
HashSourceCollection()
Initializes a new instance of the HashSourceCollection class.
bool Equals(HashSourceCollection other)
Indicates whether the current object is equal to another object of the same type. ...
A hash to uniquely identify data.
Definition: ObjectId.cs:13