wasStitchNET
/Structures/StitchFile.cs |
@@ -0,0 +1,30 @@ |
/////////////////////////////////////////////////////////////////////////// |
// Copyright (C) Wizardry and Steamworks 2013 - License: GNU GPLv3 // |
// Please see: http://www.gnu.org/licenses/gpl.html for legal details, // |
// rights of fair usage, the disclaimer and warranty conditions. // |
/////////////////////////////////////////////////////////////////////////// |
|
using System; |
using System.Collections.Generic; |
using System.Linq; |
|
namespace wasStitchNET.Structures |
{ |
public class StitchFile : IEquatable<StitchFile> |
{ |
public IEnumerable<string> Path; |
public StitchPathType PathType; |
public string SHA1; |
|
public bool Equals(StitchFile other) |
{ |
return other != null && Path.SequenceEqual(other.Path) && |
string.Equals(SHA1, other.SHA1, StringComparison.OrdinalIgnoreCase); |
} |
|
public override int GetHashCode() |
{ |
return (string.Join(string.Empty, Path) + SHA1).GetHashCode(); |
} |
} |
} |
/Structures/StitchMirror.cs |
@@ -0,0 +1,34 @@ |
/////////////////////////////////////////////////////////////////////////// |
// Copyright (C) Wizardry and Steamworks 2016 - License: GNU GPLv3 // |
// Please see: http://www.gnu.org/licenses/gpl.html for legal details, // |
// rights of fair usage, the disclaimer and warranty conditions. // |
/////////////////////////////////////////////////////////////////////////// |
|
using System; |
using wasSharp.Geo; |
|
namespace wasStitchNET.Structures |
{ |
public class StitchMirror : IEquatable<StitchMirror> |
{ |
public StitchMirror(string address, Distance distance) |
{ |
Address = address; |
Distance = distance; |
} |
|
public string Address { get; } |
|
public Distance Distance { get; } |
|
public bool Equals(StitchMirror other) |
{ |
return other != null && Address.Equals(other.Address); |
} |
|
public override int GetHashCode() |
{ |
return Address.GetHashCode() ^ Distance.GetHashCode(); |
} |
} |
} |
/Structures/StitchPathType.cs |
@@ -0,0 +1,17 @@ |
/////////////////////////////////////////////////////////////////////////// |
// Copyright (C) Wizardry and Steamworks 2016 - License: GNU GPLv3 // |
// Please see: http://www.gnu.org/licenses/gpl.html for legal details, // |
// rights of fair usage, the disclaimer and warranty conditions. // |
/////////////////////////////////////////////////////////////////////////// |
|
using System; |
|
namespace wasStitchNET.Structures |
{ |
[Flags] |
public enum StitchPathType |
{ |
PATH_FILE = 1, |
PATH_DIRECTORY = 2 |
} |
} |