forked from MrOkiDoki/BattleBit-Community-Server-API
-
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
caesarakalaeii
committed
Aug 17, 2023
1 parent
4d242bd
commit 09304a5
Showing
19 changed files
with
1,442 additions
and
1,346 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,74 +1,76 @@ | ||
using BattleBitAPI.Common; | ||
using System; | ||
namespace BattleBitAPI.Common; | ||
|
||
namespace BattleBitAPI.Common | ||
public class Attachment : IEquatable<string>, IEquatable<Attachment> | ||
Check warning on line 3 in BattleBitAPI/Common/Data/Attachment.cs GitHub Actions / build
|
||
{ | ||
public class Attachment : IEquatable<string>, IEquatable<Attachment> | ||
public Attachment(string name, AttachmentType attachmentType) | ||
{ | ||
public string Name { get; private set; } | ||
public AttachmentType AttachmentType { get; private set; } | ||
public Attachment(string name, AttachmentType attachmentType) | ||
{ | ||
Name = name; | ||
AttachmentType = attachmentType; | ||
} | ||
Name = name; | ||
AttachmentType = attachmentType; | ||
} | ||
|
||
public string Name { get; } | ||
public AttachmentType AttachmentType { get; private set; } | ||
|
||
public bool Equals(Attachment other) | ||
{ | ||
if (other == null) | ||
return false; | ||
return Name.Equals(other.Name); | ||
} | ||
|
||
public bool Equals(string other) | ||
{ | ||
if (other == null) | ||
return false; | ||
return Name.Equals(other); | ||
} | ||
|
||
public override string ToString() | ||
{ | ||
return Name; | ||
} | ||
|
||
public static bool operator ==(string left, Attachment right) | ||
{ | ||
var leftNull = ReferenceEquals(left, null); | ||
var rightNull = ReferenceEquals(right, null); | ||
if (leftNull && rightNull) | ||
return true; | ||
if (leftNull || rightNull) | ||
return false; | ||
return right.Name.Equals(left); | ||
} | ||
|
||
public static bool operator !=(string left, Attachment right) | ||
{ | ||
var leftNull = ReferenceEquals(left, null); | ||
var rightNull = ReferenceEquals(right, null); | ||
if (leftNull && rightNull) | ||
return true; | ||
if (leftNull || rightNull) | ||
return false; | ||
return right.Name.Equals(left); | ||
} | ||
|
||
public override string ToString() | ||
{ | ||
return this.Name; | ||
} | ||
public bool Equals(string other) | ||
{ | ||
if (other == null) | ||
return false; | ||
return this.Name.Equals(other); | ||
} | ||
public bool Equals(Attachment other) | ||
{ | ||
if (other == null) | ||
return false; | ||
return this.Name.Equals(other.Name); | ||
} | ||
public static bool operator ==(Attachment right, string left) | ||
{ | ||
var leftNull = ReferenceEquals(left, null); | ||
var rightNull = ReferenceEquals(right, null); | ||
if (leftNull && rightNull) | ||
return true; | ||
if (leftNull || rightNull) | ||
return false; | ||
return right.Name.Equals(left); | ||
} | ||
|
||
public static bool operator ==(string left, Attachment right) | ||
{ | ||
bool leftNull = object.ReferenceEquals(left, null); | ||
bool rightNull = object.ReferenceEquals(right, null); | ||
if (leftNull && rightNull) | ||
return true; | ||
if (leftNull || rightNull) | ||
return false; | ||
return right.Name.Equals(left); | ||
} | ||
public static bool operator !=(string left, Attachment right) | ||
{ | ||
bool leftNull = object.ReferenceEquals(left, null); | ||
bool rightNull = object.ReferenceEquals(right, null); | ||
if (leftNull && rightNull) | ||
return true; | ||
if (leftNull || rightNull) | ||
return false; | ||
return right.Name.Equals(left); | ||
} | ||
public static bool operator ==(Attachment right, string left) | ||
{ | ||
bool leftNull = object.ReferenceEquals(left, null); | ||
bool rightNull = object.ReferenceEquals(right, null); | ||
if (leftNull && rightNull) | ||
return true; | ||
if (leftNull || rightNull) | ||
return false; | ||
return right.Name.Equals(left); | ||
} | ||
public static bool operator !=(Attachment right, string left) | ||
{ | ||
bool leftNull = object.ReferenceEquals(left, null); | ||
bool rightNull = object.ReferenceEquals(right, null); | ||
if (leftNull && rightNull) | ||
return true; | ||
if (leftNull || rightNull) | ||
return false; | ||
return right.Name.Equals(left); | ||
} | ||
public static bool operator !=(Attachment right, string left) | ||
{ | ||
var leftNull = ReferenceEquals(left, null); | ||
var rightNull = ReferenceEquals(right, null); | ||
if (leftNull && rightNull) | ||
return true; | ||
if (leftNull || rightNull) | ||
return false; | ||
return right.Name.Equals(left); | ||
} | ||
} | ||
} |
Oops, something went wrong.