Change all instances of ToLower() to ToLowerInvariant()

This commit is contained in:
Mustafa Alperen Seki
2020-04-17 15:00:36 +03:00
committed by atlimit8
parent 0a9eb1ff83
commit 5b34af0f12
4 changed files with 13 additions and 13 deletions

View File

@@ -92,7 +92,7 @@ namespace OpenRA.Mods.Common.Lint
if (value == null)
continue;
if (!dict.ContainsKey(value.ToLower()))
if (!dict.ContainsKey(value.ToLowerInvariant()))
emitError("{0}.{1}.{2}: Missing weapon `{3}`."
.F(actorInfo.Name, traitInfo.GetType().Name, fieldInfo.Name, value));
}
@@ -110,7 +110,7 @@ namespace OpenRA.Mods.Common.Lint
if (value == null)
continue;
if (!dict.ContainsKey(value.ToLower()))
if (!dict.ContainsKey(value.ToLowerInvariant()))
emitError("{0}.{1}.{2}: Missing voice `{3}`."
.F(actorInfo.Name, traitInfo.GetType().Name, fieldInfo.Name, value));
}

View File

@@ -88,7 +88,7 @@ namespace OpenRA.Mods.Common.Traits
var initialFacing = self.World.Map.FacingBetween(location, self.Location, 0);
// If aircraft, spawn at cruise altitude
var aircraftInfo = self.World.Map.Rules.Actors[deliveringActorName.ToLower()].TraitInfoOrDefault<AircraftInfo>();
var aircraftInfo = self.World.Map.Rules.Actors[deliveringActorName.ToLowerInvariant()].TraitInfoOrDefault<AircraftInfo>();
if (aircraftInfo != null)
spawn += new WVec(0, 0, aircraftInfo.CruiseAltitude.Length);

View File

@@ -182,19 +182,19 @@ namespace OpenRA.Mods.Common.UtilityCommands
switch (s.Key)
{
case "Intro":
videos.Add(new MiniYamlNode("BackgroundVideo", s.Value.ToLower() + ".vqa"));
videos.Add(new MiniYamlNode("BackgroundVideo", s.Value.ToLowerInvariant() + ".vqa"));
break;
case "Brief":
videos.Add(new MiniYamlNode("BriefingVideo", s.Value.ToLower() + ".vqa"));
videos.Add(new MiniYamlNode("BriefingVideo", s.Value.ToLowerInvariant() + ".vqa"));
break;
case "Action":
videos.Add(new MiniYamlNode("StartVideo", s.Value.ToLower() + ".vqa"));
videos.Add(new MiniYamlNode("StartVideo", s.Value.ToLowerInvariant() + ".vqa"));
break;
case "Win":
videos.Add(new MiniYamlNode("WinVideo", s.Value.ToLower() + ".vqa"));
videos.Add(new MiniYamlNode("WinVideo", s.Value.ToLowerInvariant() + ".vqa"));
break;
case "Lose":
videos.Add(new MiniYamlNode("LossVideo", s.Value.ToLower() + ".vqa"));
videos.Add(new MiniYamlNode("LossVideo", s.Value.ToLowerInvariant() + ".vqa"));
break;
}
}

View File

@@ -322,7 +322,7 @@ namespace OpenRA.Mods.D2k.UtilityCommands
// Get all templates from the tileset YAML file that have at least one frame and an Image property corresponding to the requested tileset
// Each frame is a tile from the Dune 2000 tileset files, with the Frame ID being the index of the tile in the original file
tileSetsFromYaml = tileSet.Templates.Where(t => t.Value.Frames != null
&& t.Value.Images[0].ToLower() == tilesetName.ToLower()).Select(ts => ts.Value).ToList();
&& t.Value.Images[0].ToLowerInvariant() == tilesetName.ToLowerInvariant()).Select(ts => ts.Value).ToList();
var players = new MapPlayers(map.Rules, playerCount);
map.PlayerDefinitions = players.ToMiniYaml();
@@ -350,7 +350,7 @@ namespace OpenRA.Mods.D2k.UtilityCommands
if (ActorDataByActorCode.ContainsKey(tileSpecialInfo))
{
var kvp = ActorDataByActorCode[tileSpecialInfo];
if (!rules.Actors.ContainsKey(kvp.First.ToLower()))
if (!rules.Actors.ContainsKey(kvp.First.ToLowerInvariant()))
throw new InvalidOperationException("Actor with name {0} could not be found in the rules YAML file!".F(kvp.First));
var a = new ActorReference(kvp.First)
@@ -380,7 +380,7 @@ namespace OpenRA.Mods.D2k.UtilityCommands
TerrainTile GetTile(int tileIndex)
{
// Some tiles are duplicates of other tiles, just on a different tileset
if (tilesetName.ToLower() == "bloxbgbs.r8")
if (tilesetName.ToLowerInvariant() == "bloxbgbs.r8")
{
if (tileIndex == 355)
return new TerrainTile(441, 0);
@@ -389,7 +389,7 @@ namespace OpenRA.Mods.D2k.UtilityCommands
return new TerrainTile(442, 0);
}
if (tilesetName.ToLower() == "bloxtree.r8")
if (tilesetName.ToLowerInvariant() == "bloxtree.r8")
{
var indices = new[] { 683, 684, 685, 706, 703, 704, 705, 726, 723, 724, 725, 746, 743, 744, 745, 747 };
for (var i = 0; i < 16; i++)
@@ -410,7 +410,7 @@ namespace OpenRA.Mods.D2k.UtilityCommands
return new TerrainTile(215, 0);
}
if (tilesetName.ToLower() == "bloxwast.r8")
if (tilesetName.ToLowerInvariant() == "bloxwast.r8")
{
if (tileIndex == 342)
return new TerrainTile(250, 0);