SamsonGame/Assets/Scripts/Game/Save/PersistError.cs

26 lines
560 B
C#
Raw Normal View History

2021-12-29 20:50:11 +03:00
public struct PersistError
{
public PersistCode Code;
public string Description;
public long Bytes;
public static implicit operator PersistCode(PersistError err)
{
return err.Code;
}
public static implicit operator int(PersistError err)
{
return (int) err.Code;
}
public bool IsOk()
{
return Code == 0;
}
public override string ToString()
{
return Code + (Code != PersistCode.OK ? "(" + Description + ")" : ", " + Bytes + " bytes");
}
}