Add some ToString overrides to improve debug experience.
This commit is contained in:
committed by
Paul Chote
parent
3a020e96fe
commit
4cc33b2871
@@ -58,7 +58,13 @@ namespace OpenRA
|
||||
public bool Equals(CPos other) { return Bits == other.Bits; }
|
||||
public override bool Equals(object obj) { return obj is CPos && Equals((CPos)obj); }
|
||||
|
||||
public override string ToString() { return X + "," + Y; }
|
||||
public override string ToString()
|
||||
{
|
||||
if (Layer == 0)
|
||||
return X + "," + Y;
|
||||
|
||||
return X + "," + Y + "," + Layer;
|
||||
}
|
||||
|
||||
public MPos ToMPos(Map map)
|
||||
{
|
||||
|
||||
@@ -50,6 +50,11 @@ namespace OpenRA
|
||||
BottomRight = bottomRight.ToCPos(gridType);
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{TopLeft}->{BottomRight}";
|
||||
}
|
||||
|
||||
/// <summary>Expand the specified region with an additional cordon. This may expand the region outside the map borders.</summary>
|
||||
public static CellRegion Expand(CellRegion region, int cordon)
|
||||
{
|
||||
|
||||
@@ -67,6 +67,11 @@ namespace OpenRA
|
||||
bottomRight = mapBottomRight;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{TopLeft}->{BottomRight}";
|
||||
}
|
||||
|
||||
public MapCoordsEnumerator GetEnumerator()
|
||||
{
|
||||
return new MapCoordsEnumerator(this);
|
||||
|
||||
Reference in New Issue
Block a user