symmetry between reading and writing int2
This commit is contained in:
@@ -108,10 +108,7 @@ namespace OpenRA
|
|||||||
if (TargetActor != null)
|
if (TargetActor != null)
|
||||||
w.Write(UIntFromActor(TargetActor));
|
w.Write(UIntFromActor(TargetActor));
|
||||||
if (TargetLocation != int2.Zero)
|
if (TargetLocation != int2.Zero)
|
||||||
{
|
w.Write(TargetLocation);
|
||||||
w.Write(TargetLocation.X);
|
|
||||||
w.Write(TargetLocation.Y);
|
|
||||||
}
|
|
||||||
if (TargetString != null)
|
if (TargetString != null)
|
||||||
w.Write(TargetString);
|
w.Write(TargetString);
|
||||||
|
|
||||||
|
|||||||
@@ -8,10 +8,8 @@
|
|||||||
*/
|
*/
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
|
||||||
|
|
||||||
namespace OpenRA.Network
|
namespace OpenRA.Network
|
||||||
{
|
{
|
||||||
@@ -54,5 +52,11 @@ namespace OpenRA.Network
|
|||||||
var y = r.ReadInt32();
|
var y = r.ReadInt32();
|
||||||
return new int2(x, y);
|
return new int2(x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void Write(this BinaryWriter w, int2 p)
|
||||||
|
{
|
||||||
|
w.Write(p.X);
|
||||||
|
w.Write(p.Y);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user