Fix CA1305
This commit is contained in:
committed by
Matthias Mailänder
parent
486a07602b
commit
d83e579dfe
@@ -121,7 +121,7 @@ namespace OpenRA.Mods.Cnc.UtilityCommands
|
||||
{
|
||||
var iniFormat = basicSection.GetValue("NewINIFormat", "0");
|
||||
|
||||
Exts.TryParseIntegerInvariant(iniFormat, out var iniFormatVersion);
|
||||
Exts.TryParseInt32Invariant(iniFormat, out var iniFormatVersion);
|
||||
|
||||
return iniFormatVersion;
|
||||
}
|
||||
@@ -193,10 +193,10 @@ namespace OpenRA.Mods.Cnc.UtilityCommands
|
||||
|
||||
static void SetBounds(Map map, IniSection mapSection)
|
||||
{
|
||||
var offsetX = Exts.ParseIntegerInvariant(mapSection.GetValue("X", "0"));
|
||||
var offsetY = Exts.ParseIntegerInvariant(mapSection.GetValue("Y", "0"));
|
||||
var width = Exts.ParseIntegerInvariant(mapSection.GetValue("Width", "0"));
|
||||
var height = Exts.ParseIntegerInvariant(mapSection.GetValue("Height", "0"));
|
||||
var offsetX = Exts.ParseInt32Invariant(mapSection.GetValue("X", "0"));
|
||||
var offsetY = Exts.ParseInt32Invariant(mapSection.GetValue("Y", "0"));
|
||||
var width = Exts.ParseInt32Invariant(mapSection.GetValue("Width", "0"));
|
||||
var height = Exts.ParseInt32Invariant(mapSection.GetValue("Height", "0"));
|
||||
|
||||
var tl = new PPos(offsetX, offsetY);
|
||||
var br = new PPos(offsetX + width - 1, offsetY + height - 1);
|
||||
@@ -279,9 +279,9 @@ namespace OpenRA.Mods.Cnc.UtilityCommands
|
||||
void LoadWaypoints(IniSection waypointSection)
|
||||
{
|
||||
var wps = waypointSection
|
||||
.Where(kv => Exts.ParseIntegerInvariant(kv.Value) > 0)
|
||||
.Select(kv => (WaypointNumber: Exts.ParseIntegerInvariant(kv.Key),
|
||||
Location: LocationFromMapOffset(Exts.ParseIntegerInvariant(kv.Value), MapSize)));
|
||||
.Where(kv => Exts.ParseInt32Invariant(kv.Value) > 0)
|
||||
.Select(kv => (WaypointNumber: Exts.ParseInt32Invariant(kv.Key),
|
||||
Location: LocationFromMapOffset(Exts.ParseInt32Invariant(kv.Value), MapSize)));
|
||||
|
||||
// Add waypoint actors skipping duplicate entries
|
||||
var nodes = new List<MiniYamlNode>();
|
||||
@@ -327,7 +327,7 @@ namespace OpenRA.Mods.Cnc.UtilityCommands
|
||||
{
|
||||
// loc=type,loc,depth
|
||||
var parts = s.Value.Split(',');
|
||||
var loc = Exts.ParseIntegerInvariant(parts[1]);
|
||||
var loc = Exts.ParseInt32Invariant(parts[1]);
|
||||
var type = parts[0].ToLowerInvariant();
|
||||
var key = $"{loc % MapSize},{loc / MapSize}";
|
||||
var value = $"{type},{parts[2]}";
|
||||
@@ -425,9 +425,9 @@ namespace OpenRA.Mods.Cnc.UtilityCommands
|
||||
if (!players.Contains(parts[0]))
|
||||
players.Add(parts[0]);
|
||||
|
||||
var loc = Exts.ParseIntegerInvariant(parts[3]);
|
||||
var health = Exts.ParseIntegerInvariant(parts[2]) * 100 / 256;
|
||||
var facing = (section == "INFANTRY") ? Exts.ParseIntegerInvariant(parts[6]) : Exts.ParseIntegerInvariant(parts[4]);
|
||||
var loc = Exts.ParseInt32Invariant(parts[3]);
|
||||
var health = Exts.ParseInt32Invariant(parts[2]) * 100 / 256;
|
||||
var facing = (section == "INFANTRY") ? Exts.ParseInt32Invariant(parts[6]) : Exts.ParseInt32Invariant(parts[4]);
|
||||
|
||||
var actorType = parts[1].ToLowerInvariant();
|
||||
|
||||
@@ -443,7 +443,7 @@ namespace OpenRA.Mods.Cnc.UtilityCommands
|
||||
actor.Add(new FacingInit(new WAngle(1024 - 4 * facing)));
|
||||
|
||||
if (section == "INFANTRY")
|
||||
actor.Add(new SubCellInit((SubCell)Exts.ParseByte(parts[4])));
|
||||
actor.Add(new SubCellInit((SubCell)Exts.ParseByteInvariant(parts[4])));
|
||||
|
||||
if (!map.Rules.Actors.ContainsKey(parts[1].ToLowerInvariant()))
|
||||
Console.WriteLine($"Ignoring unknown actor type: `{parts[1].ToLowerInvariant()}`");
|
||||
@@ -470,7 +470,7 @@ namespace OpenRA.Mods.Cnc.UtilityCommands
|
||||
var nodes = new List<MiniYamlNode>();
|
||||
foreach (var kv in terrain)
|
||||
{
|
||||
var loc = Exts.ParseIntegerInvariant(kv.Key);
|
||||
var loc = Exts.ParseInt32Invariant(kv.Key);
|
||||
var treeActor = ParseTreeActor(kv.Value);
|
||||
|
||||
var ar = new ActorReference(treeActor)
|
||||
|
||||
@@ -207,7 +207,7 @@ namespace OpenRA.Mods.Cnc.UtilityCommands
|
||||
var waypointsSection = file.GetSection("Waypoints", true);
|
||||
foreach (var kv in waypointsSection)
|
||||
{
|
||||
var pos = int.Parse(kv.Value);
|
||||
var pos = Exts.ParseInt32Invariant(kv.Value);
|
||||
var ry = pos / 1000;
|
||||
var rx = pos - ry * 1000;
|
||||
var cell = ToMPos(rx, ry, fullSize.X).ToCPos(map);
|
||||
@@ -230,7 +230,7 @@ namespace OpenRA.Mods.Cnc.UtilityCommands
|
||||
var terrainSection = file.GetSection("Terrain", true);
|
||||
foreach (var kv in terrainSection)
|
||||
{
|
||||
var pos = int.Parse(kv.Key);
|
||||
var pos = Exts.ParseInt32Invariant(kv.Key);
|
||||
var ry = pos / 1000;
|
||||
var rx = pos - ry * 1000;
|
||||
var cell = ToMPos(rx, ry, fullSize.X).ToCPos(map);
|
||||
@@ -268,10 +268,10 @@ namespace OpenRA.Mods.Cnc.UtilityCommands
|
||||
isDeployed = true;
|
||||
}
|
||||
|
||||
var health = short.Parse(entries[2]);
|
||||
var rx = int.Parse(entries[3]);
|
||||
var ry = int.Parse(entries[4]);
|
||||
var facing = (byte)(224 - byte.Parse(entries[type == "Infantry" ? 7 : 5]));
|
||||
var health = Exts.ParseInt16Invariant(entries[2]);
|
||||
var rx = Exts.ParseInt32Invariant(entries[3]);
|
||||
var ry = Exts.ParseInt32Invariant(entries[4]);
|
||||
var facing = (byte)(224 - Exts.ParseByteInvariant(entries[type == "Infantry" ? 7 : 5]));
|
||||
|
||||
var cell = ToMPos(rx, ry, fullSize.X).ToCPos(map);
|
||||
|
||||
@@ -284,7 +284,7 @@ namespace OpenRA.Mods.Cnc.UtilityCommands
|
||||
if (type == "Infantry")
|
||||
{
|
||||
var subcell = 0;
|
||||
switch (byte.Parse(entries[5]))
|
||||
switch (Exts.ParseByteInvariant(entries[5]))
|
||||
{
|
||||
case 2: subcell = 3; break;
|
||||
case 3: subcell = 1; break;
|
||||
|
||||
@@ -196,7 +196,7 @@ namespace OpenRA.Mods.Cnc.UtilityCommands
|
||||
var sb = new StringBuilder();
|
||||
for (var i = 1; ; i++)
|
||||
{
|
||||
var line = mapPackSection.GetValue(i.ToString(), null);
|
||||
var line = mapPackSection.GetValue(i.ToStringInvariant(), null);
|
||||
if (line == null)
|
||||
break;
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace OpenRA.Mods.Cnc.UtilityCommands
|
||||
var nodes = new List<MiniYamlNode>();
|
||||
foreach (var kv in overlay)
|
||||
{
|
||||
var loc = Exts.ParseIntegerInvariant(kv.Key);
|
||||
var loc = Exts.ParseInt32Invariant(kv.Key);
|
||||
var cell = new CPos(loc % MapSize, loc / MapSize);
|
||||
|
||||
var res = (Type: (byte)0, Index: (byte)0);
|
||||
|
||||
@@ -62,8 +62,8 @@ namespace OpenRA.Mods.Cnc.UtilityCommands
|
||||
var size = foundation.Split('x');
|
||||
if (size.Length == 2)
|
||||
{
|
||||
var x = int.Parse(size[0]);
|
||||
var y = int.Parse(size[1]);
|
||||
var x = Exts.ParseInt32Invariant(size[0]);
|
||||
var y = Exts.ParseInt32Invariant(size[1]);
|
||||
|
||||
var xOffset = (x - y) * grid.TileSize.Width / 4;
|
||||
var yOffset = (x + y) * grid.TileSize.Height / 4;
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace OpenRA.Mods.Cnc.UtilityCommands
|
||||
{
|
||||
var section = file.GetSection($"TileSet{tilesetGroupIndex:D4}");
|
||||
|
||||
var sectionCount = int.Parse(section.GetValue("TilesInSet", "1"));
|
||||
var sectionCount = Exts.ParseInt32Invariant(section.GetValue("TilesInSet", "1"));
|
||||
var sectionFilename = section.GetValue("FileName", "").ToLowerInvariant();
|
||||
var sectionCategory = section.GetValue("SetName", "");
|
||||
if (!string.IsNullOrEmpty(sectionCategory) && sectionFilename != "blank")
|
||||
|
||||
Reference in New Issue
Block a user