forked from Pryaxis/TSAPI
-
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.
Line ending normalization: Windows (CRLF)
- Loading branch information
Showing
9 changed files
with
1,328 additions
and
1,323 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
* text=auto | ||
*.cs text eol=crlf | ||
*.sln text eol=crlf | ||
*.csproj text eol=crlf | ||
*.vsmdi text eol=crlf |
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,38 +1,38 @@ | ||
using System; | ||
using System.Linq; | ||
|
||
namespace TerrariaApi.Server | ||
{ | ||
internal struct HandlerRegistration<ArgsType> where ArgsType: EventArgs | ||
{ | ||
public TerrariaPlugin Registrator { get; set; } | ||
public HookHandler<ArgsType> Handler { get; set; } | ||
public int Priority { get; set; } | ||
|
||
public override int GetHashCode() | ||
{ | ||
return this.Registrator.GetHashCode() ^ this.Handler.GetHashCode() ^ this.Priority; | ||
} | ||
|
||
public override bool Equals(object obj) | ||
{ | ||
if (!(obj is HandlerRegistration<ArgsType>)) | ||
return false; | ||
|
||
HandlerRegistration<ArgsType> other = (HandlerRegistration<ArgsType>)obj; | ||
return ( | ||
this.Registrator == other.Registrator && | ||
this.Handler.Equals(other.Handler)); | ||
} | ||
|
||
public static bool operator ==(HandlerRegistration<ArgsType> a, HandlerRegistration<ArgsType> b) | ||
{ | ||
return a.Equals(b); | ||
} | ||
|
||
public static bool operator !=(HandlerRegistration<ArgsType> a, HandlerRegistration<ArgsType> b) | ||
{ | ||
return !a.Equals(b); | ||
} | ||
} | ||
using System; | ||
using System.Linq; | ||
|
||
namespace TerrariaApi.Server | ||
{ | ||
internal struct HandlerRegistration<ArgsType> where ArgsType: EventArgs | ||
{ | ||
public TerrariaPlugin Registrator { get; set; } | ||
public HookHandler<ArgsType> Handler { get; set; } | ||
public int Priority { get; set; } | ||
|
||
public override int GetHashCode() | ||
{ | ||
return this.Registrator.GetHashCode() ^ this.Handler.GetHashCode() ^ this.Priority; | ||
} | ||
|
||
public override bool Equals(object obj) | ||
{ | ||
if (!(obj is HandlerRegistration<ArgsType>)) | ||
return false; | ||
|
||
HandlerRegistration<ArgsType> other = (HandlerRegistration<ArgsType>)obj; | ||
return ( | ||
this.Registrator == other.Registrator && | ||
this.Handler.Equals(other.Handler)); | ||
} | ||
|
||
public static bool operator ==(HandlerRegistration<ArgsType> a, HandlerRegistration<ArgsType> b) | ||
{ | ||
return a.Equals(b); | ||
} | ||
|
||
public static bool operator !=(HandlerRegistration<ArgsType> a, HandlerRegistration<ArgsType> b) | ||
{ | ||
return !a.Equals(b); | ||
} | ||
} | ||
} |
Oops, something went wrong.