Mark fields readonly.

This commit is contained in:
Matthias Mailänder
2021-12-05 13:43:52 +01:00
committed by abcdefg30
parent 4a60d56753
commit b147da388a
5 changed files with 10 additions and 9 deletions

View File

@@ -283,7 +283,8 @@ namespace OpenRA.Mods.Common.Traits
IEnumerable<CPos> landingCells = Enumerable.Empty<CPos>(); IEnumerable<CPos> landingCells = Enumerable.Empty<CPos>();
bool requireForceMove; bool requireForceMove;
int creationActivityDelay;
readonly int creationActivityDelay;
bool notify = true; bool notify = true;

View File

@@ -125,9 +125,9 @@ namespace OpenRA.Mods.Common.Traits
int ticksSinceLastShot; int ticksSinceLastShot;
int currentBarrel; int currentBarrel;
int barrelCount; readonly int barrelCount;
List<(int Ticks, Action Func)> delayedActions = new List<(int, Action)>(); readonly List<(int Ticks, Action Func)> delayedActions = new List<(int, Action)>();
public WDist Recoil; public WDist Recoil;
public int FireDelay { get; protected set; } public int FireDelay { get; protected set; }

View File

@@ -274,9 +274,9 @@ namespace OpenRA.Mods.Common.Traits
readonly Actor self; readonly Actor self;
readonly BuildingInfluence influence; readonly BuildingInfluence influence;
(CPos, SubCell)[] occupiedCells; readonly (CPos, SubCell)[] occupiedCells;
(CPos, SubCell)[] targetableCells; readonly (CPos, SubCell)[] targetableCells;
CPos[] transitOnlyCells; readonly CPos[] transitOnlyCells;
public CPos TopLeft => topLeft; public CPos TopLeft => topLeft;
public WPos CenterPosition { get; private set; } public WPos CenterPosition { get; private set; }

View File

@@ -70,8 +70,8 @@ namespace OpenRA.Mods.Common.Traits
public class IndexedColorRemap : IPaletteRemap public class IndexedColorRemap : IPaletteRemap
{ {
Dictionary<int, int> replacements = new Dictionary<int, int>(); readonly Dictionary<int, int> replacements = new Dictionary<int, int>();
IPalette basePalette; readonly IPalette basePalette;
public IndexedColorRemap(IPalette basePalette, int[] ramp, int[] remap) public IndexedColorRemap(IPalette basePalette, int[] ramp, int[] remap)
{ {

View File

@@ -35,7 +35,7 @@ namespace OpenRA.Mods.Common.Traits
public class ProvidesTechPrerequisite : ITechTreePrerequisite public class ProvidesTechPrerequisite : ITechTreePrerequisite
{ {
readonly ProvidesTechPrerequisiteInfo info; readonly ProvidesTechPrerequisiteInfo info;
bool enabled; readonly bool enabled;
static readonly string[] NoPrerequisites = Array.Empty<string>(); static readonly string[] NoPrerequisites = Array.Empty<string>();