Made all traitInfo fields readonly

This came up while working on the new documentation generation and comparing the results to ORAIDE's own code parser.
This commit is contained in:
penev92
2022-04-25 03:05:30 +03:00
committed by abcdefg30
parent 135823fced
commit 2bac492a65
15 changed files with 27 additions and 27 deletions

View File

@@ -29,12 +29,12 @@ namespace OpenRA.Mods.Common.Traits
[NotificationReference("Speech")]
[Desc("The audio notification type to play.")]
public string Notification = "BaseAttack";
public readonly string Notification = "BaseAttack";
[NotificationReference("Speech")]
[Desc("The audio notification to play to allies when under attack.",
"Won't play a notification to allies if this is null.")]
public string AllyNotification = null;
public readonly string AllyNotification = null;
public override object Create(ActorInitializer init) { return new BaseAttackNotifier(init.Self, this); }
}

View File

@@ -29,7 +29,7 @@ namespace OpenRA.Mods.Common.Traits
[NotificationReference("Speech")]
[Desc("The audio notification type to play.")]
public string Notification = "HarvesterAttack";
public readonly string Notification = "HarvesterAttack";
public override object Create(ActorInitializer init) { return new HarvesterAttackNotifier(init.Self, this); }
}

View File

@@ -265,10 +265,10 @@ namespace OpenRA.Mods.Common.Traits
"Current options for PanelName are 'SKIRMISH_STATS' and 'MISSION_OBJECTIVES'.")]
public class ObjectivesPanelInfo : TraitInfo
{
public string PanelName = null;
public readonly string PanelName = null;
[Desc("in ms")]
public int ExitDelay = 1400;
public readonly int ExitDelay = 1400;
public override object Create(ActorInitializer init) { return new ObjectivesPanel(this); }
}

View File

@@ -33,7 +33,7 @@ namespace OpenRA.Mods.Common.Traits
public readonly string CannotPlaceNotification = null;
[Desc("Hotkey to toggle between PlaceBuildingVariants when placing a structure.")]
public HotkeyReference ToggleVariantKey = new HotkeyReference();
public readonly HotkeyReference ToggleVariantKey = new HotkeyReference();
public override object Create(ActorInitializer init) { return new PlaceBuilding(this); }
}

View File

@@ -176,14 +176,14 @@ namespace OpenRA.Mods.Common.Traits
public class UpdatesPlayerStatisticsInfo : TraitInfo
{
[Desc("Add to army value in statistics")]
public bool AddToArmyValue = false;
public readonly bool AddToArmyValue = false;
[Desc("Add to assets value in statistics")]
public bool AddToAssetsValue = true;
public readonly bool AddToAssetsValue = true;
[ActorReference]
[Desc("Count this actor as a different type in the spectator army display.")]
public string OverrideActor = null;
public readonly string OverrideActor = null;
public override object Create(ActorInitializer init) { return new UpdatesPlayerStatistics(this, init.Self); }
}