Update naming of enum fields in ObjType

This commit is contained in:
Salman Ahmed 2024-05-01 17:22:52 +03:00
parent 16bae4f004
commit e8a6381395
2 changed files with 58 additions and 58 deletions

View File

@ -123,58 +123,58 @@ namespace osu.Game.IO.Legacy
switch (t)
{
case ObjType.boolType:
case ObjType.BoolType:
return ReadBoolean();
case ObjType.byteType:
case ObjType.ByteType:
return ReadByte();
case ObjType.uint16Type:
case ObjType.UInt16Type:
return ReadUInt16();
case ObjType.uint32Type:
case ObjType.UInt32Type:
return ReadUInt32();
case ObjType.uint64Type:
case ObjType.UInt64Type:
return ReadUInt64();
case ObjType.sbyteType:
case ObjType.SByteType:
return ReadSByte();
case ObjType.int16Type:
case ObjType.Int16Type:
return ReadInt16();
case ObjType.int32Type:
case ObjType.Int32Type:
return ReadInt32();
case ObjType.int64Type:
case ObjType.Int64Type:
return ReadInt64();
case ObjType.charType:
case ObjType.CharType:
return ReadChar();
case ObjType.stringType:
case ObjType.StringType:
return base.ReadString();
case ObjType.singleType:
case ObjType.SingleType:
return ReadSingle();
case ObjType.doubleType:
case ObjType.DoubleType:
return ReadDouble();
case ObjType.decimalType:
case ObjType.DecimalType:
return ReadDecimal();
case ObjType.dateTimeType:
case ObjType.DateTimeType:
return ReadDateTime();
case ObjType.byteArrayType:
case ObjType.ByteArrayType:
return ReadByteArray();
case ObjType.charArrayType:
case ObjType.CharArrayType:
return ReadCharArray();
case ObjType.otherType:
case ObjType.OtherType:
throw new IOException("Deserialization of arbitrary type is not supported.");
default:
@ -185,25 +185,25 @@ namespace osu.Game.IO.Legacy
public enum ObjType : byte
{
nullType,
boolType,
byteType,
uint16Type,
uint32Type,
uint64Type,
sbyteType,
int16Type,
int32Type,
int64Type,
charType,
stringType,
singleType,
doubleType,
decimalType,
dateTimeType,
byteArrayType,
charArrayType,
otherType,
ILegacySerializableType
NullType,
BoolType,
ByteType,
UInt16Type,
UInt32Type,
UInt64Type,
SByteType,
Int16Type,
Int32Type,
Int64Type,
CharType,
StringType,
SingleType,
DoubleType,
DecimalType,
DateTimeType,
ByteArrayType,
CharArrayType,
OtherType,
LegacySerializableType
}
}

View File

@ -34,11 +34,11 @@ namespace osu.Game.IO.Legacy
{
if (str == null)
{
Write((byte)ObjType.nullType);
Write((byte)ObjType.NullType);
}
else
{
Write((byte)ObjType.stringType);
Write((byte)ObjType.StringType);
base.Write(str);
}
}
@ -125,94 +125,94 @@ namespace osu.Game.IO.Legacy
{
if (obj == null)
{
Write((byte)ObjType.nullType);
Write((byte)ObjType.NullType);
}
else
{
switch (obj)
{
case bool boolObj:
Write((byte)ObjType.boolType);
Write((byte)ObjType.BoolType);
Write(boolObj);
break;
case byte byteObj:
Write((byte)ObjType.byteType);
Write((byte)ObjType.ByteType);
Write(byteObj);
break;
case ushort ushortObj:
Write((byte)ObjType.uint16Type);
Write((byte)ObjType.UInt16Type);
Write(ushortObj);
break;
case uint uintObj:
Write((byte)ObjType.uint32Type);
Write((byte)ObjType.UInt32Type);
Write(uintObj);
break;
case ulong ulongObj:
Write((byte)ObjType.uint64Type);
Write((byte)ObjType.UInt64Type);
Write(ulongObj);
break;
case sbyte sbyteObj:
Write((byte)ObjType.sbyteType);
Write((byte)ObjType.SByteType);
Write(sbyteObj);
break;
case short shortObj:
Write((byte)ObjType.int16Type);
Write((byte)ObjType.Int16Type);
Write(shortObj);
break;
case int intObj:
Write((byte)ObjType.int32Type);
Write((byte)ObjType.Int32Type);
Write(intObj);
break;
case long longObj:
Write((byte)ObjType.int64Type);
Write((byte)ObjType.Int64Type);
Write(longObj);
break;
case char charObj:
Write((byte)ObjType.charType);
Write((byte)ObjType.CharType);
base.Write(charObj);
break;
case string stringObj:
Write((byte)ObjType.stringType);
Write((byte)ObjType.StringType);
base.Write(stringObj);
break;
case float floatObj:
Write((byte)ObjType.singleType);
Write((byte)ObjType.SingleType);
Write(floatObj);
break;
case double doubleObj:
Write((byte)ObjType.doubleType);
Write((byte)ObjType.DoubleType);
Write(doubleObj);
break;
case decimal decimalObj:
Write((byte)ObjType.decimalType);
Write((byte)ObjType.DecimalType);
Write(decimalObj);
break;
case DateTime dateTimeObj:
Write((byte)ObjType.dateTimeType);
Write((byte)ObjType.DateTimeType);
Write(dateTimeObj);
break;
case byte[] byteArray:
Write((byte)ObjType.byteArrayType);
Write((byte)ObjType.ByteArrayType);
base.Write(byteArray);
break;
case char[] charArray:
Write((byte)ObjType.charArrayType);
Write((byte)ObjType.CharArrayType);
base.Write(charArray);
break;