mirror of
https://github.com/MrOkiDoki/BattleBit-Community-Server-API.git
synced 2025-01-25 02:33:08 -03:00
74 lines
2.4 KiB
C#
74 lines
2.4 KiB
C#
using BattleBitAPI.Common;
|
|
using System;
|
|
|
|
namespace BattleBitAPI.Common
|
|
{
|
|
public class Attachment : IEquatable<string>, IEquatable<Attachment>
|
|
{
|
|
public string Name { get; private set; }
|
|
public AttachmentType AttachmentType { get; private set; }
|
|
public Attachment(string name, AttachmentType attachmentType)
|
|
{
|
|
Name = name;
|
|
AttachmentType = attachmentType;
|
|
}
|
|
|
|
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 ==(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);
|
|
}
|
|
}
|
|
}
|