Change classes that use FieldLoader to use read-only collections.
This commit is contained in:
committed by
Paul Chote
parent
797c71e500
commit
649e7e8c28
@@ -18,18 +18,18 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
public class ControlGroupsInfo : TraitInfo, IControlGroupsInfo
|
||||
{
|
||||
public readonly string[] Groups = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"];
|
||||
public readonly ImmutableArray<string> Groups = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"];
|
||||
|
||||
public override object Create(ActorInitializer init) { return new ControlGroups(init.World, this); }
|
||||
|
||||
string[] IControlGroupsInfo.Groups => Groups;
|
||||
ImmutableArray<string> IControlGroupsInfo.Groups => Groups;
|
||||
}
|
||||
|
||||
[TraitLocation(SystemActors.World | SystemActors.EditorWorld)]
|
||||
public class ControlGroups : IControlGroups, ITick, IGameSaveTraitData
|
||||
{
|
||||
readonly World world;
|
||||
public string[] Groups { get; }
|
||||
public ImmutableArray<string> Groups { get; }
|
||||
|
||||
readonly List<Actor>[] controlGroups;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user