Change classes that use FieldLoader to use read-only collections.
This commit is contained in:
committed by
Paul Chote
parent
797c71e500
commit
649e7e8c28
@@ -9,7 +9,9 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System.Collections.Frozen;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Immutable;
|
||||
using System.Linq;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Support;
|
||||
@@ -35,17 +37,18 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
|
||||
[Desc("Screen-space offsets to apply when defined conditions are enabled.",
|
||||
"A dictionary of [condition string]: [x, y offset].")]
|
||||
public readonly Dictionary<BooleanExpression, int2> Offsets = [];
|
||||
public readonly FrozenDictionary<BooleanExpression, int2> Offsets = FrozenDictionary<BooleanExpression, int2>.Empty;
|
||||
|
||||
[Desc("The number of ticks that each step in the blink pattern in active.")]
|
||||
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 ImmutableArray<BlinkState> BlinkPattern = [];
|
||||
|
||||
[Desc("Override blink conditions to use when defined conditions are enabled.",
|
||||
"A dictionary of [condition string]: [pattern].")]
|
||||
public readonly Dictionary<BooleanExpression, BlinkState[]> BlinkPatterns = [];
|
||||
public readonly FrozenDictionary<BooleanExpression, ImmutableArray<BlinkState>> BlinkPatterns =
|
||||
FrozenDictionary<BooleanExpression, ImmutableArray<BlinkState>>.Empty;
|
||||
|
||||
[ConsumedConditionReference]
|
||||
public IEnumerable<string> ConsumedConditions
|
||||
@@ -58,7 +61,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
{
|
||||
protected readonly Actor Self;
|
||||
int2 conditionalOffset;
|
||||
BlinkState[] blinkPattern;
|
||||
ImmutableArray<BlinkState> blinkPattern;
|
||||
|
||||
protected WithDecorationBase(Actor self, InfoType info)
|
||||
: base(info)
|
||||
|
||||
Reference in New Issue
Block a user