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

@@ -10,7 +10,7 @@
#endregion
using System;
using System.Collections.Generic;
using System.Collections.Frozen;
using System.Linq;
using OpenRA.Traits;
@@ -20,20 +20,20 @@ namespace OpenRA.Mods.Common.Traits
public class ResourceMapBotModuleInfo : ConditionalTraitInfo, NotBefore<IResourceLayerInfo>
{
[Desc("Harvestable and valuable resource types.")]
public readonly HashSet<string> ValuableResourceTypes = [];
public readonly FrozenSet<string> ValuableResourceTypes = FrozenSet<string>.Empty;
[Desc("Tells the AI what types are considered resource creator.")]
public readonly HashSet<string> ResourceCreatorTypes = [];
public readonly FrozenSet<string> ResourceCreatorTypes = FrozenSet<string>.Empty;
[Desc($"Actor types that are considered refineries for {nameof(HarvesterTypes)}.")]
public readonly HashSet<string> RefineryTypes = [];
public readonly FrozenSet<string> RefineryTypes = FrozenSet<string>.Empty;
[Desc($"Actor types that are considered harvesters for {nameof(ValuableResourceTypes)}.")]
public readonly HashSet<string> HarvesterTypes = [];
public readonly FrozenSet<string> HarvesterTypes = FrozenSet<string>.Empty;
[Desc("Actor types that are considered to be the base building for expansion. Other enemy units will also be recorded",
"Defence and production building is suggested")]
public readonly HashSet<string> EnemyBaseBuildingTypes = [];
public readonly FrozenSet<string> EnemyBaseBuildingTypes = FrozenSet<string>.Empty;
[Desc("Delay (in ticks) for updating the indicies.")]
public readonly int UpdateResourceMapInverval = 67;