-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6e259e8
commit 37e24f8
Showing
15 changed files
with
377 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,57 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace UnityToRebelFork.Editor | ||
{ | ||
public class VariantList : List<Variant> | ||
public class VariantList : List<Variant>, IEquatable<VariantList> | ||
{ | ||
public bool Equals(VariantList other) | ||
{ | ||
if (other == null) | ||
{ | ||
return this.Count == 0; | ||
} | ||
|
||
if (other.Count != this.Count) | ||
{ | ||
return false; | ||
} | ||
|
||
for (var index = 0; index < this.Count; index++) | ||
{ | ||
if (this[index] != other[index]) | ||
return false; | ||
} | ||
|
||
return true; | ||
} | ||
|
||
public override bool Equals(object obj) | ||
{ | ||
if (ReferenceEquals(null, obj)) return false; | ||
if (ReferenceEquals(this, obj)) return true; | ||
if (obj.GetType() != this.GetType()) return false; | ||
return Equals((VariantList)obj); | ||
} | ||
|
||
public override int GetHashCode() | ||
{ | ||
var code = new HashCode(); | ||
foreach (var val in this) | ||
{ | ||
code.Add(val); | ||
} | ||
return code.ToHashCode(); | ||
} | ||
|
||
public static bool operator ==(VariantList left, VariantList right) | ||
{ | ||
return Equals(left, right); | ||
} | ||
|
||
public static bool operator !=(VariantList left, VariantList right) | ||
{ | ||
return !Equals(left, right); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.