Changed SubCell to byte
This commit is contained in:
@@ -488,6 +488,11 @@ namespace OpenRA
|
||||
return int.Parse(s, NumberStyles.Integer, NumberFormatInfo.InvariantInfo);
|
||||
}
|
||||
|
||||
public static byte ParseByte(string s)
|
||||
{
|
||||
return byte.Parse(s, NumberStyles.Integer, NumberFormatInfo.InvariantInfo);
|
||||
}
|
||||
|
||||
public static bool TryParseIntegerInvariant(string s, out int i)
|
||||
{
|
||||
return int.TryParse(s, NumberStyles.Integer, NumberFormatInfo.InvariantInfo, out i);
|
||||
|
||||
@@ -129,7 +129,7 @@ namespace OpenRA
|
||||
if (flags.HasField(OrderFields.TargetIsCell))
|
||||
{
|
||||
var cell = new CPos(r.ReadInt32(), r.ReadInt32(), r.ReadByte());
|
||||
var subCell = (SubCell)r.ReadInt32();
|
||||
var subCell = (SubCell)r.ReadByte();
|
||||
if (world != null)
|
||||
target = Target.FromCell(world, cell, subCell);
|
||||
}
|
||||
@@ -311,7 +311,7 @@ namespace OpenRA
|
||||
if (fields.HasField(OrderFields.TargetIsCell))
|
||||
{
|
||||
w.Write(Target.SerializableCell.Value);
|
||||
w.Write((int)Target.SerializableSubCell);
|
||||
w.Write((byte)Target.SerializableSubCell);
|
||||
}
|
||||
else
|
||||
w.Write(Target.SerializablePos);
|
||||
|
||||
@@ -292,7 +292,7 @@ namespace OpenRA.Traits
|
||||
Pair<CPos, SubCell>[] OccupiedCells();
|
||||
}
|
||||
|
||||
public enum SubCell { Invalid = int.MinValue, Any = int.MinValue / 2, FullCell = 0, First = 1 }
|
||||
public enum SubCell : byte { Invalid = byte.MaxValue, Any = byte.MaxValue - 1, FullCell = 0, First = 1 }
|
||||
|
||||
public interface IPositionableInfo : IOccupySpaceInfo
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user