Change classes that use FieldLoader to use read-only collections.

This commit is contained in:
RoosterDragon
2025-11-08 12:40:56 +00:00
committed by Paul Chote
parent 797c71e500
commit 649e7e8c28
308 changed files with 1233 additions and 901 deletions

View File

@@ -9,7 +9,8 @@
*/
#endregion
using System.Collections.Generic;
using System.Collections.Frozen;
using System.Collections.Immutable;
using OpenRA.GameRules;
using OpenRA.Mods.Common.Traits;
using OpenRA.Traits;
@@ -20,13 +21,13 @@ namespace OpenRA.Mods.Common.Warheads
public class DestroyResourceWarhead : Warhead
{
[Desc("Size of the area. The resources are removed within this area.", "Provide 2 values for a ring effect (outer/inner).")]
public readonly int[] Size = [0, 0];
public readonly ImmutableArray<int> Size = [0, 0];
[Desc("Amount of resources to be removed. If zero, all resources within the area will be removed.")]
public readonly byte ResourceAmount = 0;
[Desc("Resource types to remove with this warhead.", "If empty, all resource types will be removed.")]
public readonly HashSet<string> ResourceTypes = [];
public readonly FrozenSet<string> ResourceTypes = FrozenSet<string>.Empty;
public override void DoImpact(in Target target, WarheadArgs args)
{