enum class example
>더보기
>접기
public class Requester
{
private readonly int _requestLoginType;
private readonly string _requestLoginTypeName;
public static readonly Requester USER = new Requester(1, "USER");
public static readonly Requester GAME = new Requester(2, "GAME");
public static readonly Requester ZONE = new Requester(3, "ZONE");
private Requester(int requestLoginType, string requestLoginTypeName)
{
_requestLoginType = requestLoginType;
_requestLoginTypeName = requestLoginTypeName;
}
public override string ToString()
{
return string.Format("{0}:{1}", _requestLoginType, _requestLoginTypeName);
}
public override bool Equals(object obj)
{
if (obj == null)
{
return false;
}
if (obj.GetType() != this.GetType())
{
return false;
}
return GetHashCode() == obj.GetHashCode();
}
public override int GetHashCode()
{
return _requestLoginType;
}
}