Made int2 struct immutable

This commit is contained in:
David Jiménez
2015-01-30 22:30:27 +01:00
committed by Rydra
parent 8c4ea20636
commit f15f1e41e8
11 changed files with 34 additions and 26 deletions

View File

@@ -45,9 +45,18 @@ namespace OpenRA.Graphics
.ToArray();
if (d.ContainsKey("X"))
Exts.TryParseIntegerInvariant(d["X"].Value, out Hotspot.X);
{
int x;
Exts.TryParseIntegerInvariant(d["X"].Value, out x);
Hotspot = Hotspot.WithX(x);
}
if (d.ContainsKey("Y"))
Exts.TryParseIntegerInvariant(d["Y"].Value, out Hotspot.Y);
{
int y;
Exts.TryParseIntegerInvariant(d["Y"].Value, out y);
Hotspot = Hotspot.WithY(y);
}
}
}
}