Fix IDE0090
This commit is contained in:
@@ -61,14 +61,14 @@ namespace OpenRA
|
||||
|
||||
public static readonly CVec[] Directions =
|
||||
{
|
||||
new CVec(-1, -1),
|
||||
new CVec(-1, 0),
|
||||
new CVec(-1, 1),
|
||||
new CVec(0, -1),
|
||||
new CVec(0, 1),
|
||||
new CVec(1, -1),
|
||||
new CVec(1, 0),
|
||||
new CVec(1, 1),
|
||||
new(-1, -1),
|
||||
new(-1, 0),
|
||||
new(-1, 1),
|
||||
new(0, -1),
|
||||
new(0, 1),
|
||||
new(1, -1),
|
||||
new(1, 0),
|
||||
new(1, 1),
|
||||
};
|
||||
|
||||
#region Scripting interface
|
||||
|
||||
@@ -928,8 +928,8 @@ namespace OpenRA
|
||||
{
|
||||
var endpoints = new List<IPEndPoint>
|
||||
{
|
||||
new IPEndPoint(IPAddress.IPv6Any, settings.ListenPort),
|
||||
new IPEndPoint(IPAddress.Any, settings.ListenPort)
|
||||
new(IPAddress.IPv6Any, settings.ListenPort),
|
||||
new(IPAddress.Any, settings.ListenPort)
|
||||
};
|
||||
server = new Server.Server(endpoints, settings, ModData, ServerType.Multiplayer);
|
||||
|
||||
@@ -950,7 +950,7 @@ namespace OpenRA
|
||||
// This would break the Restart button, which relies on the PlayerIndex always being the same for local servers
|
||||
var endpoints = new List<IPEndPoint>
|
||||
{
|
||||
new IPEndPoint(IPAddress.Loopback, 0)
|
||||
new(IPAddress.Loopback, 0)
|
||||
};
|
||||
server = new Server.Server(endpoints, settings, ModData, ServerType.Local);
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace OpenRA
|
||||
{
|
||||
var nodes = new List<MiniYamlNode>
|
||||
{
|
||||
new MiniYamlNode("Root", FieldSaver.Save(this))
|
||||
new("Root", FieldSaver.Save(this))
|
||||
};
|
||||
|
||||
for (var i = 0; i < Players.Count; i++)
|
||||
|
||||
@@ -159,26 +159,26 @@ namespace OpenRA
|
||||
/// <summary>Defines the order of the fields in map.yaml.</summary>
|
||||
static readonly MapField[] YamlFields =
|
||||
{
|
||||
new MapField("MapFormat"),
|
||||
new MapField("RequiresMod"),
|
||||
new MapField("Title"),
|
||||
new MapField("Author"),
|
||||
new MapField("Tileset"),
|
||||
new MapField("MapSize"),
|
||||
new MapField("Bounds"),
|
||||
new MapField("Visibility"),
|
||||
new MapField("Categories"),
|
||||
new MapField("LockPreview", required: false, ignoreIfValue: "False"),
|
||||
new MapField("Players", "PlayerDefinitions"),
|
||||
new MapField("Actors", "ActorDefinitions"),
|
||||
new MapField("Rules", "RuleDefinitions", required: false),
|
||||
new MapField("Translations", "TranslationDefinitions", required: false),
|
||||
new MapField("Sequences", "SequenceDefinitions", required: false),
|
||||
new MapField("ModelSequences", "ModelSequenceDefinitions", required: false),
|
||||
new MapField("Weapons", "WeaponDefinitions", required: false),
|
||||
new MapField("Voices", "VoiceDefinitions", required: false),
|
||||
new MapField("Music", "MusicDefinitions", required: false),
|
||||
new MapField("Notifications", "NotificationDefinitions", required: false),
|
||||
new("MapFormat"),
|
||||
new("RequiresMod"),
|
||||
new("Title"),
|
||||
new("Author"),
|
||||
new("Tileset"),
|
||||
new("MapSize"),
|
||||
new("Bounds"),
|
||||
new("Visibility"),
|
||||
new("Categories"),
|
||||
new("LockPreview", required: false, ignoreIfValue: "False"),
|
||||
new("Players", "PlayerDefinitions"),
|
||||
new("Actors", "ActorDefinitions"),
|
||||
new("Rules", "RuleDefinitions", required: false),
|
||||
new("Translations", "TranslationDefinitions", required: false),
|
||||
new("Sequences", "SequenceDefinitions", required: false),
|
||||
new("ModelSequences", "ModelSequenceDefinitions", required: false),
|
||||
new("Weapons", "WeaponDefinitions", required: false),
|
||||
new("Voices", "VoiceDefinitions", required: false),
|
||||
new("Music", "MusicDefinitions", required: false),
|
||||
new("Notifications", "NotificationDefinitions", required: false),
|
||||
};
|
||||
|
||||
// Format versions
|
||||
|
||||
@@ -116,12 +116,12 @@ namespace OpenRA
|
||||
|
||||
public readonly WVec[] SubCellOffsets =
|
||||
{
|
||||
new WVec(0, 0, 0), // full cell - index 0
|
||||
new WVec(-299, -256, 0), // top left - index 1
|
||||
new WVec(256, -256, 0), // top right - index 2
|
||||
new WVec(0, 0, 0), // center - index 3
|
||||
new WVec(-299, 256, 0), // bottom left - index 4
|
||||
new WVec(256, 256, 0), // bottom right - index 5
|
||||
new(0, 0, 0), // full cell - index 0
|
||||
new(-299, -256, 0), // top left - index 1
|
||||
new(256, -256, 0), // top right - index 2
|
||||
new(0, 0, 0), // center - index 3
|
||||
new(-299, 256, 0), // bottom left - index 4
|
||||
new(256, 256, 0), // bottom right - index 5
|
||||
};
|
||||
|
||||
public CellRamp[] Ramps { get; }
|
||||
|
||||
@@ -209,7 +209,7 @@ namespace OpenRA
|
||||
|
||||
var result = new List<List<MiniYamlNode>>
|
||||
{
|
||||
new List<MiniYamlNode>()
|
||||
new()
|
||||
};
|
||||
var parsedLines = new List<(int Level, string Key, string Value, string Comment, MiniYamlNode.SourceLocation Location)>();
|
||||
|
||||
|
||||
@@ -238,7 +238,7 @@ namespace OpenRA.Network
|
||||
// Send the trait data first to guarantee that it is available when needed
|
||||
foreach (var kv in TraitData)
|
||||
{
|
||||
var data = new List<MiniYamlNode>() { new MiniYamlNode(kv.Key.ToStringInvariant(), kv.Value) }.WriteToString();
|
||||
var data = new List<MiniYamlNode>() { new(kv.Key.ToStringInvariant(), kv.Value) }.WriteToString();
|
||||
packetFn(0, 0, Order.FromTargetString("SaveTraitData", data, true).Serialize());
|
||||
}
|
||||
|
||||
|
||||
@@ -233,7 +233,7 @@ namespace OpenRA.Network
|
||||
|
||||
public string ToPOSTData(bool lanGame)
|
||||
{
|
||||
var root = new List<MiniYamlNode>() { new MiniYamlNode("Protocol", ProtocolVersion.ToStringInvariant()) };
|
||||
var root = new List<MiniYamlNode>() { new("Protocol", ProtocolVersion.ToStringInvariant()) };
|
||||
foreach (var field in SerializeFields)
|
||||
root.Add(FieldSaver.SaveField(this, field));
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace OpenRA.Network
|
||||
|
||||
public string Serialize()
|
||||
{
|
||||
var data = new List<MiniYamlNode> { new MiniYamlNode("Handshake", FieldSaver.Save(this)) };
|
||||
var data = new List<MiniYamlNode> { new("Handshake", FieldSaver.Save(this)) };
|
||||
return data.WriteToString();
|
||||
}
|
||||
}
|
||||
@@ -79,9 +79,9 @@ namespace OpenRA.Network
|
||||
{
|
||||
var data = new List<MiniYamlNode>
|
||||
{
|
||||
new MiniYamlNode("Handshake", null,
|
||||
new("Handshake", null,
|
||||
new[] { "Mod", "Version", "Password", "Fingerprint", "AuthSignature", "OrdersProtocol" }.Select(p => FieldSaver.SaveField(this, p)).ToList()),
|
||||
new MiniYamlNode("Client", FieldSaver.Save(Client))
|
||||
new("Client", FieldSaver.Save(Client))
|
||||
};
|
||||
|
||||
return data.WriteToString();
|
||||
|
||||
@@ -91,8 +91,8 @@ namespace OpenRA.Network
|
||||
{
|
||||
var root = new List<MiniYamlNode>
|
||||
{
|
||||
new MiniYamlNode("Protocol", ProtocolVersion.ToStringInvariant()),
|
||||
new MiniYamlNode("Key", key)
|
||||
new("Protocol", ProtocolVersion.ToStringInvariant()),
|
||||
new("Key", key)
|
||||
};
|
||||
|
||||
if (arguments != null)
|
||||
|
||||
@@ -265,7 +265,7 @@ namespace OpenRA.Network
|
||||
{
|
||||
var sessionData = new List<MiniYamlNode>()
|
||||
{
|
||||
new MiniYamlNode("DisabledSpawnPoints", FieldSaver.FormatValue(DisabledSpawnPoints))
|
||||
new("DisabledSpawnPoints", FieldSaver.FormatValue(DisabledSpawnPoints))
|
||||
};
|
||||
|
||||
foreach (var client in Clients)
|
||||
|
||||
@@ -1365,8 +1365,8 @@ namespace OpenRA.Server
|
||||
{
|
||||
startGameData = new List<MiniYamlNode>()
|
||||
{
|
||||
new MiniYamlNode("SaveLastOrdersFrame", GameSave.LastOrdersFrame.ToStringInvariant()),
|
||||
new MiniYamlNode("SaveSyncFrame", GameSave.LastSyncFrame.ToStringInvariant())
|
||||
new("SaveLastOrdersFrame", GameSave.LastOrdersFrame.ToStringInvariant()),
|
||||
new("SaveSyncFrame", GameSave.LastSyncFrame.ToStringInvariant())
|
||||
}.WriteToString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -583,7 +583,7 @@ namespace OpenRA
|
||||
var data = tp.Trait.IssueTraitData(tp.Actor);
|
||||
if (data != null)
|
||||
{
|
||||
var yaml = new List<MiniYamlNode>() { new MiniYamlNode(i.ToStringInvariant(), new MiniYaml("", data)) };
|
||||
var yaml = new List<MiniYamlNode>() { new(i.ToStringInvariant(), new MiniYaml("", data)) };
|
||||
IssueOrder(Order.FromTargetString("GameSaveTraitData", yaml.WriteToString(), true));
|
||||
}
|
||||
|
||||
|
||||
@@ -88,12 +88,12 @@ namespace OpenRA.Mods.Cnc.Graphics
|
||||
var channelC = ChannelSelect[(int)t.Channel];
|
||||
return new ModelVertex[6]
|
||||
{
|
||||
new ModelVertex(coord(0, 0), s.Left, s.Top, t.Left, t.Top, channelP, channelC),
|
||||
new ModelVertex(coord(su, 0), s.Right, s.Top, t.Right, t.Top, channelP, channelC),
|
||||
new ModelVertex(coord(su, sv), s.Right, s.Bottom, t.Right, t.Bottom, channelP, channelC),
|
||||
new ModelVertex(coord(su, sv), s.Right, s.Bottom, t.Right, t.Bottom, channelP, channelC),
|
||||
new ModelVertex(coord(0, sv), s.Left, s.Bottom, t.Left, t.Bottom, channelP, channelC),
|
||||
new ModelVertex(coord(0, 0), s.Left, s.Top, t.Left, t.Top, channelP, channelC)
|
||||
new(coord(0, 0), s.Left, s.Top, t.Left, t.Top, channelP, channelC),
|
||||
new(coord(su, 0), s.Right, s.Top, t.Right, t.Top, channelP, channelC),
|
||||
new(coord(su, sv), s.Right, s.Bottom, t.Right, t.Bottom, channelP, channelC),
|
||||
new(coord(su, sv), s.Right, s.Bottom, t.Right, t.Bottom, channelP, channelC),
|
||||
new(coord(0, sv), s.Left, s.Bottom, t.Left, t.Bottom, channelP, channelC),
|
||||
new(coord(0, 0), s.Left, s.Top, t.Left, t.Top, channelP, channelC)
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -30,10 +30,10 @@ namespace OpenRA.Mods.Cnc
|
||||
// The actual facing associated with each sprite frame.
|
||||
static readonly WAngle[] SpriteFacings =
|
||||
{
|
||||
WAngle.Zero, new WAngle(40), new WAngle(74), new WAngle(112), new WAngle(146), new WAngle(172), new WAngle(200), new WAngle(228),
|
||||
new WAngle(256), new WAngle(284), new WAngle(312), new WAngle(340), new WAngle(370), new WAngle(402), new WAngle(436), new WAngle(472),
|
||||
new WAngle(512), new WAngle(552), new WAngle(588), new WAngle(626), new WAngle(658), new WAngle(684), new WAngle(712), new WAngle(740),
|
||||
new WAngle(768), new WAngle(796), new WAngle(824), new WAngle(852), new WAngle(882), new WAngle(914), new WAngle(948), new WAngle(984)
|
||||
WAngle.Zero, new(40), new(74), new(112), new(146), new(172), new(200), new(228),
|
||||
new(256), new(284), new(312), new(340), new(370), new(402), new(436), new(472),
|
||||
new(512), new(552), new(588), new(626), new(658), new(684), new(712), new(740),
|
||||
new(768), new(796), new(824), new(852), new(882), new(914), new(948), new(984)
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -73,34 +73,34 @@ namespace OpenRA.Mods.Common.HitShapes
|
||||
|
||||
combatOverlayVertsTop = new WVec[]
|
||||
{
|
||||
new WVec(TopLeft.X, TopLeft.Y, VerticalTopOffset),
|
||||
new WVec(BottomRight.X, TopLeft.Y, VerticalTopOffset),
|
||||
new WVec(BottomRight.X, BottomRight.Y, VerticalTopOffset),
|
||||
new WVec(TopLeft.X, BottomRight.Y, VerticalTopOffset),
|
||||
new(TopLeft.X, TopLeft.Y, VerticalTopOffset),
|
||||
new(BottomRight.X, TopLeft.Y, VerticalTopOffset),
|
||||
new(BottomRight.X, BottomRight.Y, VerticalTopOffset),
|
||||
new(TopLeft.X, BottomRight.Y, VerticalTopOffset),
|
||||
};
|
||||
|
||||
combatOverlayVertsBottom = new WVec[]
|
||||
{
|
||||
new WVec(TopLeft.X, TopLeft.Y, VerticalBottomOffset),
|
||||
new WVec(BottomRight.X, TopLeft.Y, VerticalBottomOffset),
|
||||
new WVec(BottomRight.X, BottomRight.Y, VerticalBottomOffset),
|
||||
new WVec(TopLeft.X, BottomRight.Y, VerticalBottomOffset),
|
||||
new(TopLeft.X, TopLeft.Y, VerticalBottomOffset),
|
||||
new(BottomRight.X, TopLeft.Y, VerticalBottomOffset),
|
||||
new(BottomRight.X, BottomRight.Y, VerticalBottomOffset),
|
||||
new(TopLeft.X, BottomRight.Y, VerticalBottomOffset),
|
||||
};
|
||||
|
||||
combatOverlayVertsSide1 = new WVec[]
|
||||
{
|
||||
new WVec(TopLeft.X, TopLeft.Y, VerticalBottomOffset),
|
||||
new WVec(TopLeft.X, TopLeft.Y, VerticalTopOffset),
|
||||
new WVec(TopLeft.X, BottomRight.Y, VerticalTopOffset),
|
||||
new WVec(TopLeft.X, BottomRight.Y, VerticalBottomOffset),
|
||||
new(TopLeft.X, TopLeft.Y, VerticalBottomOffset),
|
||||
new(TopLeft.X, TopLeft.Y, VerticalTopOffset),
|
||||
new(TopLeft.X, BottomRight.Y, VerticalTopOffset),
|
||||
new(TopLeft.X, BottomRight.Y, VerticalBottomOffset),
|
||||
};
|
||||
|
||||
combatOverlayVertsSide2 = new WVec[]
|
||||
{
|
||||
new WVec(BottomRight.X, TopLeft.Y, VerticalBottomOffset),
|
||||
new WVec(BottomRight.X, TopLeft.Y, VerticalTopOffset),
|
||||
new WVec(BottomRight.X, BottomRight.Y, VerticalTopOffset),
|
||||
new WVec(BottomRight.X, BottomRight.Y, VerticalBottomOffset),
|
||||
new(BottomRight.X, TopLeft.Y, VerticalBottomOffset),
|
||||
new(BottomRight.X, TopLeft.Y, VerticalTopOffset),
|
||||
new(BottomRight.X, BottomRight.Y, VerticalTopOffset),
|
||||
new(BottomRight.X, BottomRight.Y, VerticalBottomOffset),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ namespace OpenRA.Mods.Common.Orders
|
||||
|
||||
var variants = new List<VariantWrapper>()
|
||||
{
|
||||
new VariantWrapper(worldRenderer, queue, world.Map.Rules.Actors[name])
|
||||
new(worldRenderer, queue, world.Map.Rules.Actors[name])
|
||||
};
|
||||
|
||||
foreach (var v in variants[0].ActorInfo.TraitInfos<PlaceBuildingVariantsInfo>())
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace OpenRA.Mods.Common.Projectiles
|
||||
public class AreaBeamInfo : IProjectileInfo
|
||||
{
|
||||
[Desc("Projectile speed in WDist / tick, two values indicate a randomly picked velocity per beam.")]
|
||||
public readonly WDist[] Speed = { new WDist(128) };
|
||||
public readonly WDist[] Speed = { new(128) };
|
||||
|
||||
[Desc("The maximum duration (in ticks) of each beam burst.")]
|
||||
public readonly int Duration = 10;
|
||||
@@ -49,7 +49,7 @@ namespace OpenRA.Mods.Common.Projectiles
|
||||
public readonly int[] Falloff = { 100, 100 };
|
||||
|
||||
[Desc("Ranges at which each Falloff step is defined.")]
|
||||
public readonly WDist[] Range = { WDist.Zero, new WDist(int.MaxValue) };
|
||||
public readonly WDist[] Range = { WDist.Zero, new(int.MaxValue) };
|
||||
|
||||
[Desc("The maximum/constant/incremental inaccuracy used in conjunction with the InaccuracyType property.")]
|
||||
public readonly WDist Inaccuracy = WDist.Zero;
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace OpenRA.Mods.Common.Projectiles
|
||||
public class BulletInfo : IProjectileInfo
|
||||
{
|
||||
[Desc("Projectile speed in WDist / tick, two values indicate variable velocity.")]
|
||||
public readonly WDist[] Speed = { new WDist(17) };
|
||||
public readonly WDist[] Speed = { new(17) };
|
||||
|
||||
[Desc("The maximum/constant/incremental inaccuracy used in conjunction with the InaccuracyType property.")]
|
||||
public readonly WDist Inaccuracy = WDist.Zero;
|
||||
|
||||
@@ -320,8 +320,8 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
return new List<MiniYamlNode>()
|
||||
{
|
||||
new MiniYamlNode("InitialBaseCenter", FieldSaver.FormatValue(initialBaseCenter)),
|
||||
new MiniYamlNode("DefenseCenter", FieldSaver.FormatValue(DefenseCenter))
|
||||
new("InitialBaseCenter", FieldSaver.FormatValue(initialBaseCenter)),
|
||||
new("DefenseCenter", FieldSaver.FormatValue(DefenseCenter))
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -208,7 +208,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
return new List<MiniYamlNode>()
|
||||
{
|
||||
new MiniYamlNode("InitialBaseCenter", FieldSaver.FormatValue(initialBaseCenter))
|
||||
new("InitialBaseCenter", FieldSaver.FormatValue(initialBaseCenter))
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -508,20 +508,20 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
return new List<MiniYamlNode>()
|
||||
{
|
||||
new MiniYamlNode("Squads", "", Squads.Select(s => new MiniYamlNode("Squad", s.Serialize())).ToList()),
|
||||
new MiniYamlNode("InitialBaseCenter", FieldSaver.FormatValue(initialBaseCenter)),
|
||||
new MiniYamlNode("UnitsHangingAroundTheBase", FieldSaver.FormatValue(unitsHangingAroundTheBase
|
||||
new("Squads", "", Squads.Select(s => new MiniYamlNode("Squad", s.Serialize())).ToList()),
|
||||
new("InitialBaseCenter", FieldSaver.FormatValue(initialBaseCenter)),
|
||||
new("UnitsHangingAroundTheBase", FieldSaver.FormatValue(unitsHangingAroundTheBase
|
||||
.Where(a => !unitCannotBeOrdered(a))
|
||||
.Select(a => a.ActorID)
|
||||
.ToArray())),
|
||||
new MiniYamlNode("ActiveUnits", FieldSaver.FormatValue(activeUnits
|
||||
new("ActiveUnits", FieldSaver.FormatValue(activeUnits
|
||||
.Where(a => !unitCannotBeOrdered(a))
|
||||
.Select(a => a.ActorID)
|
||||
.ToArray())),
|
||||
new MiniYamlNode("RushTicks", FieldSaver.FormatValue(rushTicks)),
|
||||
new MiniYamlNode("AssignRolesTicks", FieldSaver.FormatValue(assignRolesTicks)),
|
||||
new MiniYamlNode("AttackForceTicks", FieldSaver.FormatValue(attackForceTicks)),
|
||||
new MiniYamlNode("MinAttackForceDelayTicks", FieldSaver.FormatValue(minAttackForceDelayTicks)),
|
||||
new("RushTicks", FieldSaver.FormatValue(rushTicks)),
|
||||
new("AssignRolesTicks", FieldSaver.FormatValue(assignRolesTicks)),
|
||||
new("AttackForceTicks", FieldSaver.FormatValue(attackForceTicks)),
|
||||
new("MinAttackForceDelayTicks", FieldSaver.FormatValue(minAttackForceDelayTicks)),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -137,8 +137,8 @@ namespace OpenRA.Mods.Common.Traits.BotModules.Squads
|
||||
{
|
||||
var nodes = new List<MiniYamlNode>()
|
||||
{
|
||||
new MiniYamlNode("Type", FieldSaver.FormatValue(Type)),
|
||||
new MiniYamlNode("Units", FieldSaver.FormatValue(Units.Select(a => a.ActorID).ToArray()))
|
||||
new("Type", FieldSaver.FormatValue(Type)),
|
||||
new("Units", FieldSaver.FormatValue(Units.Select(a => a.ActorID).ToArray()))
|
||||
};
|
||||
|
||||
if (Target != Target.Invalid)
|
||||
|
||||
@@ -219,7 +219,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
return new List<MiniYamlNode>()
|
||||
{
|
||||
new MiniYamlNode("WaitingPowers", "", waitingPowersNodes)
|
||||
new("WaitingPowers", "", waitingPowersNodes)
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -228,8 +228,8 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
return new List<MiniYamlNode>()
|
||||
{
|
||||
new MiniYamlNode("QueuedBuildRequests", FieldSaver.FormatValue(queuedBuildRequests.ToArray())),
|
||||
new MiniYamlNode("IdleUnitCount", FieldSaver.FormatValue(idleUnitCount))
|
||||
new("QueuedBuildRequests", FieldSaver.FormatValue(queuedBuildRequests.ToArray())),
|
||||
new("IdleUnitCount", FieldSaver.FormatValue(idleUnitCount))
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
var nodes = new List<MiniYamlNode>()
|
||||
{
|
||||
new MiniYamlNode("Viewport", FieldSaver.FormatValue(worldRenderer.Viewport.CenterPosition))
|
||||
new("Viewport", FieldSaver.FormatValue(worldRenderer.Viewport.CenterPosition))
|
||||
};
|
||||
|
||||
var renderPlayer = worldRenderer.World.RenderPlayer;
|
||||
|
||||
@@ -129,7 +129,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
return new List<MiniYamlNode>()
|
||||
{
|
||||
new MiniYamlNode("Groups", new MiniYaml("", groups))
|
||||
new("Groups", new MiniYaml("", groups))
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -181,7 +181,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
return new List<MiniYamlNode>()
|
||||
{
|
||||
new MiniYamlNode("Selection", FieldSaver.FormatValue(Actors.Select(a => a.ActorID).ToArray()))
|
||||
new("Selection", FieldSaver.FormatValue(Actors.Select(a => a.ActorID).ToArray()))
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -103,29 +103,29 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
|
||||
fromBackup = true;
|
||||
tilesetExtensionsNode = new List<MiniYamlNodeBuilder>()
|
||||
{
|
||||
new MiniYamlNodeBuilder("TEMPERAT", ".tem"),
|
||||
new MiniYamlNodeBuilder("SNOW", ".sno"),
|
||||
new MiniYamlNodeBuilder("INTERIOR", ".int"),
|
||||
new MiniYamlNodeBuilder("DESERT", ".des"),
|
||||
new MiniYamlNodeBuilder("JUNGLE", ".jun"),
|
||||
new("TEMPERAT", ".tem"),
|
||||
new("SNOW", ".sno"),
|
||||
new("INTERIOR", ".int"),
|
||||
new("DESERT", ".des"),
|
||||
new("JUNGLE", ".jun"),
|
||||
};
|
||||
break;
|
||||
case "ra":
|
||||
fromBackup = true;
|
||||
tilesetExtensionsNode = new List<MiniYamlNodeBuilder>()
|
||||
{
|
||||
new MiniYamlNodeBuilder("TEMPERAT", ".tem"),
|
||||
new MiniYamlNodeBuilder("SNOW", ".sno"),
|
||||
new MiniYamlNodeBuilder("INTERIOR", ".int"),
|
||||
new MiniYamlNodeBuilder("DESERT", ".des"),
|
||||
new("TEMPERAT", ".tem"),
|
||||
new("SNOW", ".sno"),
|
||||
new("INTERIOR", ".int"),
|
||||
new("DESERT", ".des"),
|
||||
};
|
||||
break;
|
||||
case "ts":
|
||||
fromBackup = true;
|
||||
tilesetExtensionsNode = new List<MiniYamlNodeBuilder>()
|
||||
{
|
||||
new MiniYamlNodeBuilder("TEMPERATE", ".tem"),
|
||||
new MiniYamlNodeBuilder("SNOW", ".sno"),
|
||||
new("TEMPERATE", ".tem"),
|
||||
new("SNOW", ".sno"),
|
||||
};
|
||||
break;
|
||||
}
|
||||
@@ -148,8 +148,8 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
|
||||
fromBackup = true;
|
||||
tilesetCodesNode = new List<MiniYamlNodeBuilder>()
|
||||
{
|
||||
new MiniYamlNodeBuilder("TEMPERATE", "t"),
|
||||
new MiniYamlNodeBuilder("SNOW", "a"),
|
||||
new("TEMPERATE", "t"),
|
||||
new("SNOW", "a"),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace OpenRA.Mods.Common.UpdateRules
|
||||
// release-to-bleed path.
|
||||
static readonly UpdatePath[] Paths =
|
||||
{
|
||||
new UpdatePath("release-20210321", "release-20230225", new UpdateRule[]
|
||||
new("release-20210321", "release-20230225", new UpdateRule[]
|
||||
{
|
||||
new RenameMPTraits(),
|
||||
new RemovePlayerHighlightPalette(),
|
||||
@@ -61,7 +61,7 @@ namespace OpenRA.Mods.Common.UpdateRules
|
||||
new UnhardcodeBaseBuilderBotModule(),
|
||||
}),
|
||||
|
||||
new UpdatePath("release-20230225", "release-20231010", new UpdateRule[]
|
||||
new("release-20230225", "release-20231010", new UpdateRule[]
|
||||
{
|
||||
new TextNotificationsDisplayWidgetRemoveTime(),
|
||||
new RenameEngineerRepair(),
|
||||
@@ -78,7 +78,7 @@ namespace OpenRA.Mods.Common.UpdateRules
|
||||
new RemoveNegativeSequenceLength(),
|
||||
}),
|
||||
|
||||
new UpdatePath("release-20231010", new UpdateRule[]
|
||||
new("release-20231010", new UpdateRule[]
|
||||
{
|
||||
// bleed only changes here.
|
||||
new RemoveValidRelationsFromCapturable(),
|
||||
|
||||
@@ -167,7 +167,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
|
||||
var statsDropDownOptions = new StatsDropDownOption[]
|
||||
{
|
||||
new StatsDropDownOption
|
||||
new()
|
||||
{
|
||||
Title = TranslationProvider.GetString(InformationNone),
|
||||
IsSelected = () => activePanel == ObserverStatsPanel.None,
|
||||
|
||||
@@ -280,7 +280,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
{
|
||||
var botOptions = new List<DropDownOption>()
|
||||
{
|
||||
new DropDownOption()
|
||||
new()
|
||||
{
|
||||
Title = TranslationProvider.GetString(Add),
|
||||
IsSelected = () => false,
|
||||
|
||||
@@ -63,8 +63,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
{
|
||||
TranslationProvider.GetString(Slot), new List<SlotDropDownOption>
|
||||
{
|
||||
new SlotDropDownOption(open, "slot_open " + slot.PlayerReference, () => !slot.Closed && client == null),
|
||||
new SlotDropDownOption(closed, "slot_close " + slot.PlayerReference, () => slot.Closed)
|
||||
new(open, "slot_open " + slot.PlayerReference, () => !slot.Closed && client == null),
|
||||
new(closed, "slot_close " + slot.PlayerReference, () => slot.Closed)
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -113,7 +113,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
|
||||
var options = new List<DropDownOption>
|
||||
{
|
||||
new DropDownOption
|
||||
new()
|
||||
{
|
||||
Title = "Kick",
|
||||
OnClick = onClick
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace OpenRA.Server
|
||||
// HACK: Related to the above one, initialize the translations so we can load maps with their (translated) lobby options.
|
||||
TranslationProvider.Initialize(modData, modData.DefaultFileSystem);
|
||||
|
||||
var endpoints = new List<IPEndPoint> { new IPEndPoint(IPAddress.IPv6Any, settings.ListenPort), new IPEndPoint(IPAddress.Any, settings.ListenPort) };
|
||||
var endpoints = new List<IPEndPoint> { new(IPAddress.IPv6Any, settings.ListenPort), new(IPAddress.Any, settings.ListenPort) };
|
||||
var server = new Server(endpoints, settings, modData, ServerType.Dedicated);
|
||||
|
||||
GC.Collect();
|
||||
|
||||
@@ -98,7 +98,7 @@ namespace OpenRA.Test
|
||||
{
|
||||
// Rectangle like above,
|
||||
// Note: The calculations don't match for all, but do have a tolerance of 1.
|
||||
shape = new PolygonShape(new int2[] { new int2(-123, -456), new int2(100, -456), new int2(100, 100), new int2(-123, 100) });
|
||||
shape = new PolygonShape(new int2[] { new(-123, -456), new(100, -456), new(100, 100), new(-123, 100) });
|
||||
shape.Initialize();
|
||||
|
||||
Assert.That(shape.DistanceFromEdge(new WVec(10, 10, 0)).Length,
|
||||
@@ -121,7 +121,7 @@ namespace OpenRA.Test
|
||||
|
||||
// Rectangle like above but reverse order
|
||||
// Note: The calculations don't match for all, but do have a tolerance of 1.
|
||||
shape = new PolygonShape(new int2[] { new int2(-123, 100), new int2(100, 100), new int2(100, -456), new int2(-123, -456) });
|
||||
shape = new PolygonShape(new int2[] { new(-123, 100), new(100, 100), new(100, -456), new(-123, -456) });
|
||||
shape.Initialize();
|
||||
|
||||
Assert.That(shape.DistanceFromEdge(new WVec(10, 10, 0)).Length,
|
||||
@@ -143,7 +143,7 @@ namespace OpenRA.Test
|
||||
Is.EqualTo(877));
|
||||
|
||||
// Right triangle taken from above by removing a point
|
||||
shape = new PolygonShape(new int2[] { new int2(-123, -456), new int2(100, -456), new int2(100, 100) });
|
||||
shape = new PolygonShape(new int2[] { new(-123, -456), new(100, -456), new(100, 100) });
|
||||
shape.Initialize();
|
||||
|
||||
Assert.That(shape.DistanceFromEdge(new WVec(10, 10, 0)).Length,
|
||||
@@ -171,7 +171,7 @@ namespace OpenRA.Test
|
||||
Is.EqualTo(878));
|
||||
|
||||
// Right triangle taken from above but reverse order
|
||||
shape = new PolygonShape(new int2[] { new int2(100, 100), new int2(100, -456), new int2(-123, -456) });
|
||||
shape = new PolygonShape(new int2[] { new(100, 100), new(100, -456), new(-123, -456) });
|
||||
shape.Initialize();
|
||||
|
||||
Assert.That(shape.DistanceFromEdge(new WVec(10, 10, 0)).Length,
|
||||
|
||||
Reference in New Issue
Block a user