Fix CA1825 warnings on empty array initialisation.
This commit is contained in:
committed by
abcdefg30
parent
727084c5fc
commit
07815143f1
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using OpenRA.Activities;
|
||||
using OpenRA.Mods.Common.Traits;
|
||||
@@ -23,7 +24,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
public readonly string ToActor;
|
||||
public CVec Offset = CVec.Zero;
|
||||
public WAngle Facing = new WAngle(384);
|
||||
public string[] Sounds = { };
|
||||
public string[] Sounds = Array.Empty<string>();
|
||||
public string Notification = null;
|
||||
public int ForceHealthPercentage = 0;
|
||||
public bool SkipMakeAnims = false;
|
||||
|
||||
@@ -9,11 +9,13 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
|
||||
namespace OpenRA
|
||||
{
|
||||
public class AssetBrowser : IGlobalModData
|
||||
{
|
||||
[FieldLoader.Require]
|
||||
public readonly string[] SupportedExtensions = new string[0];
|
||||
public readonly string[] SupportedExtensions = Array.Empty<string>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.Effects;
|
||||
@@ -19,7 +20,7 @@ namespace OpenRA.Mods.Common.Effects
|
||||
{
|
||||
public class RevealShroudEffect : IEffect
|
||||
{
|
||||
static readonly PPos[] NoCells = { };
|
||||
static readonly PPos[] NoCells = Array.Empty<PPos>();
|
||||
|
||||
readonly WPos pos;
|
||||
readonly Player player;
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
@@ -21,8 +22,8 @@ namespace OpenRA
|
||||
public class ModPackage
|
||||
{
|
||||
public readonly string Title;
|
||||
public readonly string[] TestFiles = { };
|
||||
public readonly string[] Sources = { };
|
||||
public readonly string[] TestFiles = Array.Empty<string>();
|
||||
public readonly string[] Sources = Array.Empty<string>();
|
||||
public readonly bool Required;
|
||||
public readonly string Download;
|
||||
|
||||
@@ -106,21 +107,21 @@ namespace OpenRA
|
||||
}
|
||||
|
||||
[FieldLoader.LoadUsing(nameof(LoadDownloads))]
|
||||
public readonly string[] Downloads = { };
|
||||
public readonly string[] Downloads = Array.Empty<string>();
|
||||
|
||||
static object LoadDownloads(MiniYaml yaml)
|
||||
{
|
||||
var downloadNode = yaml.Nodes.FirstOrDefault(n => n.Key == "Downloads");
|
||||
return downloadNode != null ? downloadNode.Value.Nodes.Select(n => n.Key).ToArray() : new string[0];
|
||||
return downloadNode != null ? downloadNode.Value.Nodes.Select(n => n.Key).ToArray() : Array.Empty<string>();
|
||||
}
|
||||
|
||||
[FieldLoader.LoadUsing(nameof(LoadSources))]
|
||||
public readonly string[] Sources = { };
|
||||
public readonly string[] Sources = Array.Empty<string>();
|
||||
|
||||
static object LoadSources(MiniYaml yaml)
|
||||
{
|
||||
var sourceNode = yaml.Nodes.FirstOrDefault(n => n.Key == "Sources");
|
||||
return sourceNode != null ? sourceNode.Value.Nodes.Select(n => n.Key).ToArray() : new string[0];
|
||||
return sourceNode != null ? sourceNode.Value.Nodes.Select(n => n.Key).ToArray() : Array.Empty<string>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using OpenRA.Traits;
|
||||
|
||||
@@ -24,16 +25,16 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public readonly PlayerRelationship ValidRelationships = PlayerRelationship.Ally;
|
||||
|
||||
[Desc("Play a randomly selected sound from this list when accepting cash.")]
|
||||
public readonly string[] Sounds = { };
|
||||
public readonly string[] Sounds = Array.Empty<string>();
|
||||
|
||||
public override object Create(ActorInitializer init) { return new AcceptsDeliveredCash(init.Self, this); }
|
||||
public override object Create(ActorInitializer init) { return new AcceptsDeliveredCash(this); }
|
||||
}
|
||||
|
||||
public class AcceptsDeliveredCash : INotifyCashTransfer
|
||||
{
|
||||
readonly AcceptsDeliveredCashInfo info;
|
||||
|
||||
public AcceptsDeliveredCash(Actor self, AcceptsDeliveredCashInfo info)
|
||||
public AcceptsDeliveredCash(AcceptsDeliveredCashInfo info)
|
||||
{
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.Traits;
|
||||
@@ -35,7 +36,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public abstract class AffectsShroud : ConditionalTrait<AffectsShroudInfo>, ISync, INotifyAddedToWorld,
|
||||
INotifyRemovedFromWorld, INotifyMoving, INotifyCenterPositionChanged, ITick
|
||||
{
|
||||
static readonly PPos[] NoCells = { };
|
||||
static readonly PPos[] NoCells = Array.Empty<PPos>();
|
||||
|
||||
readonly HashSet<PPos> footprint;
|
||||
|
||||
|
||||
@@ -139,10 +139,10 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public readonly WDist AltitudeVelocity = new WDist(43);
|
||||
|
||||
[Desc("Sounds to play when the actor is taking off.")]
|
||||
public readonly string[] TakeoffSounds = { };
|
||||
public readonly string[] TakeoffSounds = Array.Empty<string>();
|
||||
|
||||
[Desc("Sounds to play when the actor is landing.")]
|
||||
public readonly string[] LandingSounds = { };
|
||||
public readonly string[] LandingSounds = Array.Empty<string>();
|
||||
|
||||
[Desc("The distance of the resupply base that the aircraft will wait for its turn.")]
|
||||
public readonly WDist WaitDistanceFromResupplyBase = new WDist(3072);
|
||||
|
||||
@@ -41,10 +41,10 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
[Desc("Muzzle position relative to turret or body, (forward, right, up) triples.",
|
||||
"If weapon Burst = 1, it cycles through all listed offsets, otherwise the offset corresponding to current burst is used.")]
|
||||
public readonly WVec[] LocalOffset = { };
|
||||
public readonly WVec[] LocalOffset = Array.Empty<WVec>();
|
||||
|
||||
[Desc("Muzzle yaw relative to turret or body.")]
|
||||
public readonly WAngle[] LocalYaw = { };
|
||||
public readonly WAngle[] LocalYaw = Array.Empty<WAngle>();
|
||||
|
||||
[Desc("Move the turret backwards when firing.")]
|
||||
public readonly WDist Recoil = WDist.Zero;
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using OpenRA.Traits;
|
||||
|
||||
@@ -20,7 +21,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
"This can be prefixed with ! to invert the prerequisite (disabling production if the prerequisite is available)",
|
||||
"and/or ~ to hide the actor from the production palette if the prerequisite is not available.",
|
||||
"Prerequisites are granted by actors with the ProvidesPrerequisite trait.")]
|
||||
public readonly string[] Prerequisites = { };
|
||||
public readonly string[] Prerequisites = Array.Empty<string>();
|
||||
|
||||
[Desc("Production queue(s) that can produce this.")]
|
||||
public readonly HashSet<string> Queue = new HashSet<string>();
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.Effects;
|
||||
@@ -24,7 +25,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public readonly string[] Types = { "GroundLevelBridge" };
|
||||
|
||||
[Desc("Offsets to look for adjacent bridges to act on")]
|
||||
public readonly CVec[] NeighbourOffsets = { };
|
||||
public readonly CVec[] NeighbourOffsets = Array.Empty<CVec>();
|
||||
|
||||
[Desc("Delay between each segment repair step")]
|
||||
public readonly int RepairPropagationDelay = 20;
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using OpenRA.Primitives;
|
||||
using OpenRA.Traits;
|
||||
|
||||
@@ -25,7 +26,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Actor type to replace with on repair.")]
|
||||
public readonly string ReplaceWithActor = null;
|
||||
|
||||
public readonly CVec[] NeighbourOffsets = { };
|
||||
public readonly CVec[] NeighbourOffsets = Array.Empty<CVec>();
|
||||
|
||||
public override object Create(ActorInitializer init) { return new BridgePlaceholder(init.Self, this); }
|
||||
}
|
||||
|
||||
@@ -56,9 +56,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Clear smudges from underneath the building footprint on transform.")]
|
||||
public readonly bool RemoveSmudgesOnTransform = true;
|
||||
|
||||
public readonly string[] BuildSounds = { };
|
||||
public readonly string[] BuildSounds = Array.Empty<string>();
|
||||
|
||||
public readonly string[] UndeploySounds = { };
|
||||
public readonly string[] UndeploySounds = Array.Empty<string>();
|
||||
|
||||
public override object Create(ActorInitializer init) { return new Building(init, this); }
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using OpenRA.GameRules;
|
||||
using OpenRA.Primitives;
|
||||
@@ -23,7 +24,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
public readonly string Type = "GroundLevelBridge";
|
||||
|
||||
public readonly CVec[] NeighbourOffsets = { };
|
||||
public readonly CVec[] NeighbourOffsets = Array.Empty<CVec>();
|
||||
|
||||
[WeaponReference]
|
||||
[Desc("The name of the weapon to use when demolishing the bridge")]
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.Mods.Common.Orders;
|
||||
@@ -38,7 +39,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
[Desc("List of production queues for which the primary flag should be set.",
|
||||
"If empty, the list given in the `Produces` property of the `" + nameof(Production) + "` trait will be used.")]
|
||||
public readonly string[] ProductionQueues = { };
|
||||
public readonly string[] ProductionQueues = Array.Empty<string>();
|
||||
|
||||
[CursorReference]
|
||||
[Desc("Cursor to display when setting the primary building.")]
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.Mods.Common.Effects;
|
||||
@@ -42,7 +43,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public readonly bool IsPlayerPalette = true;
|
||||
|
||||
[Desc("A list of 0 or more offsets defining the initial rally point path.")]
|
||||
public readonly CVec[] Path = { };
|
||||
public readonly CVec[] Path = Array.Empty<CVec>();
|
||||
|
||||
[NotificationReference("Speech")]
|
||||
[Desc("The speech notification to play when setting a new rallypoint.")]
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public readonly HashSet<string> Types = new HashSet<string>();
|
||||
|
||||
[Desc("A list of actor types that are initially spawned into this actor.")]
|
||||
public readonly string[] InitialUnits = { };
|
||||
public readonly string[] InitialUnits = Array.Empty<string>();
|
||||
|
||||
[Desc("When this actor is sold should all of its passengers be unloaded?")]
|
||||
public readonly bool EjectOnSell = true;
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using OpenRA.Traits;
|
||||
|
||||
@@ -24,7 +25,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
[FieldLoader.Require]
|
||||
[Desc("Bot types that trigger the condition.")]
|
||||
public readonly string[] Bots = { };
|
||||
public readonly string[] Bots = Array.Empty<string>();
|
||||
|
||||
public override object Create(ActorInitializer init) { return new GrantConditionOnBotOwner(init, this); }
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Common.Traits
|
||||
@@ -22,10 +23,10 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public readonly string Condition = null;
|
||||
|
||||
[Desc("Play a random sound from this list when enabled.")]
|
||||
public readonly string[] EnabledSounds = { };
|
||||
public readonly string[] EnabledSounds = Array.Empty<string>();
|
||||
|
||||
[Desc("Play a random sound from this list when disabled.")]
|
||||
public readonly string[] DisabledSounds = { };
|
||||
public readonly string[] DisabledSounds = Array.Empty<string>();
|
||||
|
||||
[Desc("Levels of damage at which to grant the condition.")]
|
||||
public readonly DamageState ValidDamageStates = DamageState.Heavy | DamageState.Critical;
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Common.Traits
|
||||
@@ -22,10 +23,10 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public readonly string Condition = null;
|
||||
|
||||
[Desc("Play a random sound from this list when enabled.")]
|
||||
public readonly string[] EnabledSounds = { };
|
||||
public readonly string[] EnabledSounds = Array.Empty<string>();
|
||||
|
||||
[Desc("Play a random sound from this list when disabled.")]
|
||||
public readonly string[] DisabledSounds = { };
|
||||
public readonly string[] DisabledSounds = Array.Empty<string>();
|
||||
|
||||
[Desc("Minimum level of health at which to grant the condition.")]
|
||||
public readonly int MinHP = 0;
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using OpenRA.Traits;
|
||||
|
||||
@@ -24,7 +25,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
[FieldLoader.Require]
|
||||
[Desc("List of required prerequisites.")]
|
||||
public readonly string[] Prerequisites = { };
|
||||
public readonly string[] Prerequisites = Array.Empty<string>();
|
||||
|
||||
public override object Create(ActorInitializer init) { return new GrantConditionOnPrerequisite(init.Self, this); }
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using OpenRA.Traits;
|
||||
|
||||
@@ -23,7 +24,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
[FieldLoader.Require]
|
||||
[Desc("Terrain names to trigger the condition.")]
|
||||
public readonly string[] TerrainTypes = { };
|
||||
public readonly string[] TerrainTypes = Array.Empty<string>();
|
||||
|
||||
public override object Create(ActorInitializer init) { return new GrantConditionOnTerrain(init, this); }
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using OpenRA.Traits;
|
||||
|
||||
@@ -23,7 +24,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
[FieldLoader.Require]
|
||||
[Desc("Tile set IDs to trigger the condition.")]
|
||||
public readonly string[] TileSets = { };
|
||||
public readonly string[] TileSets = Array.Empty<string>();
|
||||
|
||||
public override object Create(ActorInitializer init) { return new GrantConditionOnTileSet(this); }
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using OpenRA.Mods.Common.Effects;
|
||||
using OpenRA.Traits;
|
||||
@@ -42,11 +43,11 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public readonly int TimeDelay = 0;
|
||||
|
||||
[Desc("Only allow this crate action when the collector has these prerequisites")]
|
||||
public readonly string[] Prerequisites = { };
|
||||
public readonly string[] Prerequisites = Array.Empty<string>();
|
||||
|
||||
[ActorReference]
|
||||
[Desc("Actor types that this crate action will not occur for.")]
|
||||
public string[] ExcludedActorTypes = { };
|
||||
public string[] ExcludedActorTypes = Array.Empty<string>();
|
||||
|
||||
public override object Create(ActorInitializer init) { return new CrateAction(init.Self, this); }
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.Primitives;
|
||||
@@ -22,7 +23,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[ActorReference]
|
||||
[FieldLoader.Require]
|
||||
[Desc("The list of units to spawn.")]
|
||||
public readonly string[] Units = { };
|
||||
public readonly string[] Units = Array.Empty<string>();
|
||||
|
||||
[Desc("Factions that are allowed to trigger this action.")]
|
||||
public readonly HashSet<string> ValidFactions = new HashSet<string>();
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using OpenRA.Primitives;
|
||||
using OpenRA.Traits;
|
||||
@@ -30,7 +31,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
[FieldLoader.Require]
|
||||
[Desc("Terrain types where the actor will take damage.")]
|
||||
public readonly string[] Terrain = { };
|
||||
public readonly string[] Terrain = Array.Empty<string>();
|
||||
|
||||
public override object Create(ActorInitializer init) { return new DamagedByTerrain(this); }
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using OpenRA.Mods.Common.Activities;
|
||||
using OpenRA.Mods.Common.Orders;
|
||||
@@ -30,7 +31,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public readonly string Type = null;
|
||||
|
||||
[Desc("Sound to play when delivering cash")]
|
||||
public readonly string[] Sounds = { };
|
||||
public readonly string[] Sounds = Array.Empty<string>();
|
||||
|
||||
[CursorReference]
|
||||
[Desc("Cursor to display when hovering over a valid actor to deliver cash to.")]
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.Traits;
|
||||
@@ -22,7 +23,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public readonly int Multiplier = 100;
|
||||
|
||||
[Desc("Only apply this cost change if owner has these prerequisites.")]
|
||||
public readonly string[] Prerequisites = { };
|
||||
public readonly string[] Prerequisites = Array.Empty<string>();
|
||||
|
||||
[Desc("Queues that this cost will apply.")]
|
||||
public readonly HashSet<string> Queue = new HashSet<string>();
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.Traits;
|
||||
@@ -22,7 +23,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public readonly int Multiplier = 100;
|
||||
|
||||
[Desc("Only apply this time change if owner has these prerequisites.")]
|
||||
public readonly string[] Prerequisites = { };
|
||||
public readonly string[] Prerequisites = Array.Empty<string>();
|
||||
|
||||
[Desc("Queues that this time will apply.")]
|
||||
public readonly HashSet<string> Queue = new HashSet<string>();
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Primitives;
|
||||
@@ -32,7 +33,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
[FieldLoader.Require]
|
||||
[Desc("Remap these indices to player colors.")]
|
||||
public readonly int[] RemapIndex = { };
|
||||
public readonly int[] RemapIndex = Array.Empty<int>();
|
||||
|
||||
[Desc("Allow palette modifiers to change the palette.")]
|
||||
public readonly bool AllowModifiers = true;
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Primitives;
|
||||
using OpenRA.Traits;
|
||||
@@ -28,7 +29,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public readonly string Name = "resources";
|
||||
|
||||
[Desc("Remap these indices to pre-defined colors.")]
|
||||
public readonly int[] RemapIndex = { };
|
||||
public readonly int[] RemapIndex = Array.Empty<int>();
|
||||
|
||||
[Desc("The fixed color to remap.")]
|
||||
public readonly Color Color;
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using OpenRA.Graphics;
|
||||
@@ -32,11 +33,11 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
[FieldLoader.Require]
|
||||
[Desc("Indices from BasePalette to be swapped with ReplaceIndex.")]
|
||||
public readonly int[] Index = { };
|
||||
public readonly int[] Index = Array.Empty<int>();
|
||||
|
||||
[FieldLoader.Require]
|
||||
[Desc("Indices from BasePalette to replace from Index.")]
|
||||
public readonly int[] ReplaceIndex = { };
|
||||
public readonly int[] ReplaceIndex = Array.Empty<int>();
|
||||
|
||||
[Desc("Allow palette modifiers to change the palette.")]
|
||||
public readonly bool AllowModifiers = true;
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Primitives;
|
||||
@@ -29,7 +30,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public readonly string BaseName = "player";
|
||||
|
||||
[Desc("Remap these indices to player colors.")]
|
||||
public readonly int[] RemapIndex = { };
|
||||
public readonly int[] RemapIndex = Array.Empty<int>();
|
||||
|
||||
[Desc("Allow palette modifiers to change the palette.")]
|
||||
public readonly bool AllowModifiers = true;
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using OpenRA.FileSystem;
|
||||
using OpenRA.Graphics;
|
||||
@@ -36,7 +37,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public readonly int[] TransparentIndex = { 0 };
|
||||
|
||||
[Desc("Map listed indices to shadow. Ignores previous color.")]
|
||||
public readonly int[] ShadowIndex = { };
|
||||
public readonly int[] ShadowIndex = Array.Empty<int>();
|
||||
|
||||
public readonly bool AllowModifiers = true;
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public readonly string Filename = null;
|
||||
|
||||
[Desc("Map listed indices to shadow. Ignores previous color.")]
|
||||
public readonly int[] ShadowIndex = { };
|
||||
public readonly int[] ShadowIndex = Array.Empty<int>();
|
||||
|
||||
public readonly bool AllowModifiers = true;
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Primitives;
|
||||
using OpenRA.Traits;
|
||||
@@ -28,7 +29,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public readonly string BaseName = "player";
|
||||
|
||||
[Desc("Remap these indices to player colors.")]
|
||||
public readonly int[] RemapIndex = { };
|
||||
public readonly int[] RemapIndex = Array.Empty<int>();
|
||||
|
||||
[Desc("Allow palette modifiers to change the palette.")]
|
||||
public readonly bool AllowModifiers = true;
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
public class ClassicParallelProductionQueue : ProductionQueue
|
||||
{
|
||||
static readonly ActorInfo[] NoItems = { };
|
||||
static readonly ActorInfo[] NoItems = Array.Empty<ActorInfo>();
|
||||
|
||||
readonly Actor self;
|
||||
readonly ClassicParallelProductionQueueInfo info;
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.Primitives;
|
||||
@@ -35,7 +36,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
public class ClassicProductionQueue : ProductionQueue
|
||||
{
|
||||
static readonly ActorInfo[] NoItems = { };
|
||||
static readonly ActorInfo[] NoItems = Array.Empty<ActorInfo>();
|
||||
|
||||
readonly Actor self;
|
||||
readonly ClassicProductionQueueInfo info;
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.Traits;
|
||||
@@ -21,7 +22,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public readonly string Prerequisite = null;
|
||||
|
||||
[Desc("Only grant this prerequisite when you have these prerequisites.")]
|
||||
public readonly string[] RequiresPrerequisites = { };
|
||||
public readonly string[] RequiresPrerequisites = Array.Empty<string>();
|
||||
|
||||
[Desc("Only grant this prerequisite for certain factions.")]
|
||||
public readonly HashSet<string> Factions = new HashSet<string>();
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using OpenRA.Traits;
|
||||
|
||||
@@ -24,7 +25,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public readonly string Name;
|
||||
|
||||
[Desc("Prerequisites to grant when this tech level is active.")]
|
||||
public readonly string[] Prerequisites = { };
|
||||
public readonly string[] Prerequisites = Array.Empty<string>();
|
||||
|
||||
IEnumerable<string> ITechTreePrerequisiteInfo.Prerequisites(ActorInfo info) { return Prerequisites; }
|
||||
|
||||
@@ -36,7 +37,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
readonly ProvidesTechPrerequisiteInfo info;
|
||||
bool enabled;
|
||||
|
||||
static readonly string[] NoPrerequisites = new string[0];
|
||||
static readonly string[] NoPrerequisites = Array.Empty<string>();
|
||||
|
||||
public string Name => info.Name;
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Common.Traits
|
||||
@@ -18,7 +19,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
"trait, the production queue icon renders with an overlay defined in that trait.")]
|
||||
public class ProducibleWithLevelInfo : TraitInfo, Requires<GainsExperienceInfo>
|
||||
{
|
||||
public readonly string[] Prerequisites = { };
|
||||
public readonly string[] Prerequisites = Array.Empty<string>();
|
||||
|
||||
[Desc("Number of levels to give to the actor on creation.")]
|
||||
public readonly int InitialLevels = 1;
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
[FieldLoader.Require]
|
||||
[Desc("e.g. Infantry, Vehicles, Aircraft, Buildings")]
|
||||
public readonly string[] Produces = { };
|
||||
public readonly string[] Produces = Array.Empty<string>();
|
||||
|
||||
public override object Create(ActorInitializer init) { return new Production(init, this); }
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.Graphics;
|
||||
@@ -39,7 +40,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
public readonly string Palette = "chrome";
|
||||
|
||||
[Desc("Name(s) of AmmoPool(s) that use this decoration. Leave empty to include all pools.")]
|
||||
public readonly string[] AmmoPools = { };
|
||||
public readonly string[] AmmoPools = Array.Empty<string>();
|
||||
|
||||
public override object Create(ActorInitializer init) { return new WithAmmoPipsDecoration(init.Self, this); }
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
class WithCrateBodyInfo : TraitInfo, Requires<RenderSpritesInfo>, IRenderActorPreviewSpritesInfo
|
||||
{
|
||||
[Desc("Easteregg sequences to use in December.")]
|
||||
public readonly string[] XmasImages = { };
|
||||
public readonly string[] XmasImages = Array.Empty<string>();
|
||||
|
||||
[Desc("Terrain types on which to display WaterSequence.")]
|
||||
public readonly HashSet<string> WaterTerrainTypes = new HashSet<string> { "Water" };
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.Graphics;
|
||||
@@ -20,7 +21,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
class WithDeadBridgeSpriteBodyInfo : WithSpriteBodyInfo
|
||||
{
|
||||
[ActorReference]
|
||||
public readonly string[] RampActors = { };
|
||||
public readonly string[] RampActors = Array.Empty<string>();
|
||||
|
||||
[Desc("Offset to search for the 'A' neighbour")]
|
||||
public readonly CVec AOffset = CVec.Zero;
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.Graphics;
|
||||
@@ -41,7 +42,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
public readonly int BlinkInterval = 5;
|
||||
|
||||
[Desc("A pattern of ticks (BlinkInterval long) where the decoration is visible or hidden.")]
|
||||
public readonly BlinkState[] BlinkPattern = { };
|
||||
public readonly BlinkState[] BlinkPattern = Array.Empty<BlinkState>();
|
||||
|
||||
[Desc("Override blink conditions to use when defined conditions are enabled.",
|
||||
"A dictionary of [condition string]: [pattern].")]
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.Graphics;
|
||||
@@ -20,7 +21,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
class WithGateSpriteBodyInfo : WithSpriteBodyInfo, IWallConnectorInfo, Requires<GateInfo>
|
||||
{
|
||||
[Desc("Cells (outside the gate footprint) that contain wall cells that can connect to the gate")]
|
||||
public readonly CVec[] WallConnections = { };
|
||||
public readonly CVec[] WallConnections = Array.Empty<CVec>();
|
||||
|
||||
[Desc("Wall type for connections")]
|
||||
public readonly string Type = "wall";
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.Graphics;
|
||||
@@ -35,7 +36,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
public readonly Dictionary<string, string[]> AttackSequences = new Dictionary<string, string[]>();
|
||||
|
||||
[SequenceReference]
|
||||
public readonly string[] IdleSequences = { };
|
||||
public readonly string[] IdleSequences = Array.Empty<string>();
|
||||
|
||||
[SequenceReference]
|
||||
public readonly string[] StandSequences = { "stand" };
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public readonly int RefundPercent = 50;
|
||||
|
||||
[Desc("List of audio clips to play when the actor is being sold.")]
|
||||
public readonly string[] SellSounds = { };
|
||||
public readonly string[] SellSounds = Array.Empty<string>();
|
||||
|
||||
[NotificationReference("Speech")]
|
||||
[Desc("The audio notification type to play.")]
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using OpenRA.Traits;
|
||||
|
||||
@@ -18,7 +19,7 @@ namespace OpenRA.Mods.Common.Traits.Sound
|
||||
public class AttackSoundsInfo : ConditionalTraitInfo
|
||||
{
|
||||
[Desc("Play a randomly selected sound from this list when preparing for an attack or attacking.")]
|
||||
public readonly string[] Sounds = { };
|
||||
public readonly string[] Sounds = Array.Empty<string>();
|
||||
|
||||
[Desc("Delay in ticks before sound starts, either relative to attack preparation or attack.")]
|
||||
public readonly int Delay = 0;
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using OpenRA.Primitives;
|
||||
using OpenRA.Traits;
|
||||
|
||||
@@ -17,10 +18,10 @@ namespace OpenRA.Mods.Common.Traits.Sound
|
||||
public class SoundOnDamageTransitionInfo : TraitInfo
|
||||
{
|
||||
[Desc("Play a random sound from this list when damaged.")]
|
||||
public readonly string[] DamagedSounds = { };
|
||||
public readonly string[] DamagedSounds = Array.Empty<string>();
|
||||
|
||||
[Desc("Play a random sound from this list when destroyed.")]
|
||||
public readonly string[] DestroyedSounds = { };
|
||||
public readonly string[] DestroyedSounds = Array.Empty<string>();
|
||||
|
||||
[Desc("DamageType(s) that trigger the sounds. Leave empty to always trigger a sound.")]
|
||||
public readonly BitSet<DamageType> DamageTypes = default(BitSet<DamageType>);
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.GameRules;
|
||||
@@ -61,7 +62,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
[SequenceReference(nameof(TrailImage), allowNullImage: true)]
|
||||
[Desc("Loop a randomly chosen sequence of TrailImage from this list while this projectile is moving.")]
|
||||
public readonly string[] TrailSequences = { };
|
||||
public readonly string[] TrailSequences = Array.Empty<string>();
|
||||
|
||||
[Desc("Interval in ticks between each spawned Trail animation.")]
|
||||
public readonly int TrailInterval = 1;
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
[ActorReference(typeof(PassengerInfo))]
|
||||
[Desc("Troops to be delivered. They will be distributed between the planes if SquadSize > 1.")]
|
||||
public readonly string[] DropItems = { };
|
||||
public readonly string[] DropItems = Array.Empty<string>();
|
||||
|
||||
[Desc("Risks stuck units when they don't have the Paratrooper trait.")]
|
||||
public readonly bool AllowImpassableCells = false;
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using OpenRA.Traits;
|
||||
|
||||
@@ -45,7 +46,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("If set to true, the support power will be fully charged when it becomes available. " +
|
||||
"Normal rules apply for subsequent charges.")]
|
||||
public readonly bool StartFullyCharged = false;
|
||||
public readonly string[] Prerequisites = { };
|
||||
public readonly string[] Prerequisites = Array.Empty<string>();
|
||||
|
||||
public readonly string DetectedSound = null;
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
Powers[order.OrderString].Activate(order);
|
||||
}
|
||||
|
||||
static readonly SupportPowerInstance[] NoInstances = { };
|
||||
static readonly SupportPowerInstance[] NoInstances = Array.Empty<SupportPowerInstance>();
|
||||
|
||||
public IEnumerable<SupportPowerInstance> GetPowersForActor(Actor a)
|
||||
{
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using OpenRA.GameRules;
|
||||
using OpenRA.Traits;
|
||||
@@ -21,7 +22,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[WeaponReference]
|
||||
[FieldLoader.Require]
|
||||
[Desc("The weapons used for shrapnel.")]
|
||||
public readonly string[] Weapons = { };
|
||||
public readonly string[] Weapons = Array.Empty<string>();
|
||||
|
||||
[Desc("The amount of pieces of shrapnel to expel. Two values indicate a range.")]
|
||||
public readonly int[] Pieces = { 3, 10 };
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using OpenRA.Activities;
|
||||
using OpenRA.Mods.Common.Activities;
|
||||
@@ -32,10 +33,10 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public readonly WAngle Facing = new WAngle(384);
|
||||
|
||||
[Desc("Sounds to play when transforming.")]
|
||||
public readonly string[] TransformSounds = { };
|
||||
public readonly string[] TransformSounds = Array.Empty<string>();
|
||||
|
||||
[Desc("Sounds to play when the transformation is blocked.")]
|
||||
public readonly string[] NoTransformSounds = { };
|
||||
public readonly string[] NoTransformSounds = Array.Empty<string>();
|
||||
|
||||
[NotificationReference("Speech")]
|
||||
[Desc("Notification to play when transforming.")]
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.Primitives;
|
||||
@@ -32,7 +33,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[FieldLoader.Require]
|
||||
[ActorReference]
|
||||
[Desc("Name of the actor that will be randomly picked to spawn.")]
|
||||
public readonly string[] Actors = { };
|
||||
public readonly string[] Actors = Array.Empty<string>();
|
||||
|
||||
public readonly string Owner = "Creeps";
|
||||
|
||||
|
||||
@@ -32,10 +32,10 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public readonly float SimilarityThreshold = 0.314f;
|
||||
|
||||
[Desc("List of hue components for the preset colors in the palette tab. Each entry must have a corresponding PresetSaturations definition.")]
|
||||
public readonly float[] PresetHues = { };
|
||||
public readonly float[] PresetHues = Array.Empty<float>();
|
||||
|
||||
[Desc("List of saturation components for the preset colors in the palette tab. Each entry must have a corresponding PresetHues definition.")]
|
||||
public readonly float[] PresetSaturations = { };
|
||||
public readonly float[] PresetSaturations = Array.Empty<float>();
|
||||
|
||||
[ActorReference]
|
||||
[Desc("Actor type to show in the color picker. This can be overridden for specific factions with FactionPreviewActors.")]
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using OpenRA.Traits;
|
||||
|
||||
@@ -36,7 +37,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
[Desc("A group of units ready to defend or scout.")]
|
||||
[ActorReference]
|
||||
public readonly string[] SupportActors = { };
|
||||
public readonly string[] SupportActors = Array.Empty<string>();
|
||||
|
||||
[Desc("Inner radius for spawning support actors")]
|
||||
public readonly int InnerSupportRadius = 2;
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[FieldLoader.Require]
|
||||
[SequenceReference(nameof(Image))]
|
||||
[Desc("Randomly chosen image sequences.")]
|
||||
public readonly string[] Sequences = { };
|
||||
public readonly string[] Sequences = Array.Empty<string>();
|
||||
|
||||
[PaletteReference]
|
||||
[Desc("Palette used for rendering the resource sprites.")]
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
@@ -42,7 +43,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
[SequenceReference(nameof(SmokeImage))]
|
||||
[Desc("Smoke sprite sequences randomly chosen from")]
|
||||
public readonly string[] SmokeSequences = { };
|
||||
public readonly string[] SmokeSequences = Array.Empty<string>();
|
||||
|
||||
[PaletteReference]
|
||||
public readonly string SmokePalette = "effect";
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using OpenRA.GameRules;
|
||||
using OpenRA.Mods.Common.Effects;
|
||||
@@ -22,7 +23,7 @@ namespace OpenRA.Mods.Common.Warheads
|
||||
{
|
||||
[SequenceReference(nameof(Image), allowNullImage: true)]
|
||||
[Desc("List of explosion sequences that can be used.")]
|
||||
public readonly string[] Explosions = new string[0];
|
||||
public readonly string[] Explosions = Array.Empty<string>();
|
||||
|
||||
[Desc("Image containing explosion effect sequence.")]
|
||||
public readonly string Image = "explosion";
|
||||
@@ -38,7 +39,7 @@ namespace OpenRA.Mods.Common.Warheads
|
||||
public readonly bool ForceDisplayAtGroundLevel = false;
|
||||
|
||||
[Desc("List of sounds that can be played on impact.")]
|
||||
public readonly string[] ImpactSounds = new string[0];
|
||||
public readonly string[] ImpactSounds = Array.Empty<string>();
|
||||
|
||||
[Desc("Chance of impact sound to play.")]
|
||||
public readonly int ImpactSoundChance = 100;
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
readonly World world;
|
||||
|
||||
int selectionHash;
|
||||
Actor[] selectedActors = { };
|
||||
Actor[] selectedActors = Array.Empty<Actor>();
|
||||
bool attackMoveDisabled = true;
|
||||
bool forceMoveDisabled = true;
|
||||
bool forceAttackDisabled = true;
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
template = scrollPanel.Get<ContainerWidget>("PACKAGE_TEMPLATE");
|
||||
|
||||
var headerTemplate = panel.Get<LabelWidget>("HEADER_TEMPLATE");
|
||||
var headerLines = !string.IsNullOrEmpty(content.HeaderMessage) ? content.HeaderMessage.Replace("\\n", "\n").Split('\n') : new string[0];
|
||||
var headerLines = !string.IsNullOrEmpty(content.HeaderMessage) ? content.HeaderMessage.Replace("\\n", "\n").Split('\n') : Array.Empty<string>();
|
||||
var headerHeight = 0;
|
||||
foreach (var l in headerLines)
|
||||
{
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
|
||||
var panel = widget.Get("CONTENT_PROMPT_PANEL");
|
||||
var headerTemplate = panel.Get<LabelWidget>("HEADER_TEMPLATE");
|
||||
var headerLines = !string.IsNullOrEmpty(content.InstallPromptMessage) ? content.InstallPromptMessage.Replace("\\n", "\n").Split('\n') : new string[0];
|
||||
var headerLines = !string.IsNullOrEmpty(content.InstallPromptMessage) ? content.InstallPromptMessage.Replace("\\n", "\n").Split('\n') : Array.Empty<string>();
|
||||
var headerHeight = 0;
|
||||
foreach (var l in headerLines)
|
||||
{
|
||||
|
||||
@@ -136,7 +136,7 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
count = FieldLoader.GetValue<int>("HotkeyCount", countNode.Value.Value);
|
||||
|
||||
if (count == 0)
|
||||
return new string[0];
|
||||
return Array.Empty<string>();
|
||||
|
||||
if (string.IsNullOrEmpty(prefix))
|
||||
emitError($"{widgetNode.Location} must define HotkeyPrefix if HotkeyCount > 0.");
|
||||
|
||||
@@ -80,7 +80,7 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
count = FieldLoader.GetValue<int>("HotkeyCount", countNode.Value.Value);
|
||||
|
||||
if (count == 0)
|
||||
return new string[0];
|
||||
return Array.Empty<string>();
|
||||
|
||||
if (string.IsNullOrEmpty(prefix))
|
||||
emitError($"{widgetNode.Location} must define HotkeyPrefix if HotkeyCount > 0.");
|
||||
|
||||
Reference in New Issue
Block a user