Use expression body syntax

This commit is contained in:
teinarss
2021-02-25 20:52:13 +01:00
committed by Paul Chote
parent 555c43843b
commit 4a1e4f3e16
403 changed files with 1342 additions and 2031 deletions

View File

@@ -16,21 +16,17 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
{
public class AddPipDecorationTraits : UpdateRule
{
public override string Name { get { return "Add decoration traits for selection pips."; } }
public override string Description
{
get
{
return "The AmmoPool, Cargo, Harvester, and StoresResources traits no longer\n" +
"automatically add pips to the selection box. New traits WithAmmoPipsDecoration,\n" +
"WithCargoPipsDecoration, WithHarvesterPipsDecoration,\n" +
"WithResourceStoragePipsDecoration are added to provide the same functionality.\n\n" +
"Passenger.PipType has been replaced with CustomPipType, which now references a\n" +
"sequence defined in WithCargoDecoration.CustomPipTypeSequences.\n\n" +
"ResourceType.PipColor has been removed and resource pip colours are now defined\n" +
"in WithHarvesterPipsDecoration.ResourceSequences.";
}
}
public override string Name => "Add decoration traits for selection pips.";
public override string Description =>
"The AmmoPool, Cargo, Harvester, and StoresResources traits no longer\n" +
"automatically add pips to the selection box. New traits WithAmmoPipsDecoration,\n" +
"WithCargoPipsDecoration, WithHarvesterPipsDecoration,\n" +
"WithResourceStoragePipsDecoration are added to provide the same functionality.\n\n" +
"Passenger.PipType has been replaced with CustomPipType, which now references a\n" +
"sequence defined in WithCargoDecoration.CustomPipTypeSequences.\n\n" +
"ResourceType.PipColor has been removed and resource pip colours are now defined\n" +
"in WithHarvesterPipsDecoration.ResourceSequences.";
static readonly Dictionary<string, string> PipReplacements = new Dictionary<string, string>
{

View File

@@ -15,15 +15,11 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
{
class ChangeTargetLineDelayToMilliseconds : UpdateRule
{
public override string Name { get { return "Changed DrawLineToTarget.Delay interpretation from ticks to milliseconds."; } }
public override string Description
{
get
{
return "Going forward, the value of the `Delay` attribute of the `DrawLineToTarget` trait will be\n" +
"interpreted as milliseconds instead of ticks.\n";
}
}
public override string Name => "Changed DrawLineToTarget.Delay interpretation from ticks to milliseconds.";
public override string Description =>
"Going forward, the value of the `Delay` attribute of the `DrawLineToTarget` trait will be\n" +
"interpreted as milliseconds instead of ticks.\n";
public override IEnumerable<string> UpdateActorNode(ModData modData, MiniYamlNode actorNode)
{

View File

@@ -16,16 +16,12 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
{
public class ConvertSupportPowerRangesToFootprint : UpdateRule
{
public override string Name { get { return "Convert support power ranges to footprint"; } }
public override string Description
{
get
{
return "ChronoshiftPower and GrantExternalConditionPower use footprint areas\n" +
"instead of a circular range and they no longer have a fallback default area value.\n" +
"The old Range values will be converted to footprints as part of this update.";
}
}
public override string Name => "Convert support power ranges to footprint";
public override string Description =>
"ChronoshiftPower and GrantExternalConditionPower use footprint areas\n" +
"instead of a circular range and they no longer have a fallback default area value.\n" +
"The old Range values will be converted to footprints as part of this update.";
static readonly string[] AffectedTraits = new string[] { "GrantExternalConditionPower", "ChronoshiftPower" };

View File

@@ -17,15 +17,9 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
{
public class CreateFlashPaletteEffectWarhead : UpdateRule
{
public override string Name { get { return "Create FlashPaletteEffectWarhead to replace hardcoded nuke flashing."; } }
public override string Name => "Create FlashPaletteEffectWarhead to replace hardcoded nuke flashing.";
public override string Description
{
get
{
return "The trait NukePower (via the NukeLaunch projectile that it uses) no longer has built-in palette flashing.";
}
}
public override string Description => "The trait NukePower (via the NukeLaunch projectile that it uses) no longer has built-in palette flashing.";
readonly List<Tuple<string, string, string>> weaponsToUpdate = new List<Tuple<string, string, string>>();

View File

@@ -18,19 +18,15 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
{
public class ModernizeDecorationTraits : UpdateRule
{
public override string Name { get { return "Modernize SelectionDecorations and With*Decoration traits."; } }
public override string Description
{
get
{
return "The configuration properties exposed on the SelectionDecorations and With*Decoration\n" +
"traits have been reworked. RenderSelectionBars and RenderSelectionBox have been removed from\n" +
"SelectionDecorations. The obsolete ZOffset and ScreenOffset has been removed from With*Decoration, and ReferencePoint has\n" +
"been replaced by Position which takes a single value (TopLeft, TopRight, BottomLeft, BottomRight, Center, or Top).\n" +
"A new Margin property is available to control the decoration offset relative to the edges of the selection box.\n" +
"RenderNameTag has been renamed to WithNameTagDecoration and now behaves like a normal decoration trait.\n";
}
}
public override string Name => "Modernize SelectionDecorations and With*Decoration traits.";
public override string Description =>
"The configuration properties exposed on the SelectionDecorations and With*Decoration\n" +
"traits have been reworked. RenderSelectionBars and RenderSelectionBox have been removed from\n" +
"SelectionDecorations. The obsolete ZOffset and ScreenOffset has been removed from With*Decoration, and ReferencePoint has\n" +
"been replaced by Position which takes a single value (TopLeft, TopRight, BottomLeft, BottomRight, Center, or Top).\n" +
"A new Margin property is available to control the decoration offset relative to the edges of the selection box.\n" +
"RenderNameTag has been renamed to WithNameTagDecoration and now behaves like a normal decoration trait.\n";
static readonly string[] LegacyDecorationTraits = { "WithDecoration", "WithSpriteControlGroupDecoration", "WithTextControlGroupDecoration", "WithTextDecoration", "WithBuildingRepairDecoration", "InfiltrateForDecoration" };
static readonly string[] ModernDecorationTraits = { "WithAmmoPipsDecoration", "WithCargoPipsDecoration", "WithHarvesterPipsDecoration", "WithResourceStoragePipsDecoration", "WithNameTagDecoration" };

View File

@@ -16,15 +16,11 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
{
public class MoveClassicFacingFudge : UpdateRule
{
public override string Name { get { return "UseClassicFacingFudge functionality was moved to Cnc-specific sequence/coordinate code."; } }
public override string Description
{
get
{
return "UseClassicFacingFudge has been replaced with ClassicFacingBodyOrientation trait\n" +
"and Classic* variants of *Sequence loaders respectively, both located in Mods.Cnc.";
}
}
public override string Name => "UseClassicFacingFudge functionality was moved to Cnc-specific sequence/coordinate code.";
public override string Description =>
"UseClassicFacingFudge has been replaced with ClassicFacingBodyOrientation trait\n" +
"and Classic* variants of *Sequence loaders respectively, both located in Mods.Cnc.";
readonly List<string> locations = new List<string>();

View File

@@ -15,15 +15,9 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
{
public class RemoveConditionManager : UpdateRule
{
public override string Name { get { return "ConditionManager trait has been removed."; } }
public override string Name => "ConditionManager trait has been removed.";
public override string Description
{
get
{
return "ConditionManager trait has been removed. Its functionality has been integrated into the actor itself.";
}
}
public override string Description => "ConditionManager trait has been removed. Its functionality has been integrated into the actor itself.";
public override IEnumerable<string> UpdateActorNode(ModData modData, MiniYamlNode actorNode)
{

View File

@@ -15,14 +15,9 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
{
public class RemoveLaysTerrain : UpdateRule
{
public override string Name { get { return "'LaysTerrain' has been removed in favor of the new 'D2kBuilding' trait."; } }
public override string Description
{
get
{
return "'LaysTerrain' was removed.";
}
}
public override string Name => "'LaysTerrain' has been removed in favor of the new 'D2kBuilding' trait.";
public override string Description => "'LaysTerrain' was removed.";
public override IEnumerable<string> UpdateActorNode(ModData modData, MiniYamlNode actorNode)
{

View File

@@ -15,16 +15,12 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
{
public class RemoveMuzzleSplitFacings : UpdateRule
{
public override string Name { get { return "Remove Armament.MuzzleSplitFacings."; } }
public override string Description
{
get
{
return "The legacy MuzzleSplitFacings option was removed from Armament.\n" +
"The same result can be created by using `Combine` in the sequence definitions to\n" +
"assemble the different facings sprites into a single sequence.";
}
}
public override string Name => "Remove Armament.MuzzleSplitFacings.";
public override string Description =>
"The legacy MuzzleSplitFacings option was removed from Armament.\n" +
"The same result can be created by using `Combine` in the sequence definitions to\n" +
"assemble the different facings sprites into a single sequence.";
public override IEnumerable<string> UpdateActorNode(ModData modData, MiniYamlNode actorNode)
{

View File

@@ -15,14 +15,9 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
{
public class RenameCircleContrast : UpdateRule
{
public override string Name { get { return "Rename 'ContrastColor' to 'BorderColor'."; } }
public override string Description
{
get
{
return "RenderDetectionCircle and RenderShroudCircle ContrastColor have been renamed to BorderColor for consistency.";
}
}
public override string Name => "Rename 'ContrastColor' to 'BorderColor'.";
public override string Description => "RenderDetectionCircle and RenderShroudCircle ContrastColor have been renamed to BorderColor for consistency.";
public override IEnumerable<string> UpdateActorNode(ModData modData, MiniYamlNode actorNode)
{

View File

@@ -15,14 +15,9 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
{
public class RenameHealCrateAction : UpdateRule
{
public override string Name { get { return "Rename 'HealUnitsCrateAction' to 'HealActorsCrateAction'."; } }
public override string Description
{
get
{
return "The 'HealUnitsCrateAction' has been renamed to 'HealActorsCrateAction'.";
}
}
public override string Name => "Rename 'HealUnitsCrateAction' to 'HealActorsCrateAction'.";
public override string Description => "The 'HealUnitsCrateAction' has been renamed to 'HealActorsCrateAction'.";
public override IEnumerable<string> UpdateActorNode(ModData modData, MiniYamlNode actorNode)
{

View File

@@ -15,14 +15,9 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
{
class RenameInfiltrationNotifications : UpdateRule
{
public override string Name { get { return "Renamed InfiltrateForCash Notification to InfiltratedNotification."; } }
public override string Description
{
get
{
return "The InfiltrateForCash Notification has been renamed to be in line with new notification properties added.";
}
}
public override string Name => "Renamed InfiltrateForCash Notification to InfiltratedNotification.";
public override string Description => "The InfiltrateForCash Notification has been renamed to be in line with new notification properties added.";
public override IEnumerable<string> UpdateActorNode(ModData modData, MiniYamlNode actorNode)
{

View File

@@ -16,15 +16,11 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
{
public class RenameSelfHealing : UpdateRule
{
public override string Name { get { return "SelfHealing was renamed as negative SelfHealing is a common usecase."; } }
public override string Description
{
get
{
return "SelfHealing was renamed to ChangesHealth\n" +
"HealIfBelow was renamed to StartIfBelow.";
}
}
public override string Name => "SelfHealing was renamed as negative SelfHealing is a common usecase.";
public override string Description =>
"SelfHealing was renamed to ChangesHealth\n" +
"HealIfBelow was renamed to StartIfBelow.";
public override IEnumerable<string> UpdateActorNode(ModData modData, MiniYamlNode actorNode)
{

View File

@@ -15,15 +15,11 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
{
public class RenameStances : UpdateRule
{
public override string Name { get { return "Renamed player 'Stances' to 'Relationships'."; } }
public override string Description
{
get
{
return "'Stances' in regards to a player have been renamed to 'Relationships'.\n" +
"The yaml values did not change.";
}
}
public override string Name => "Renamed player 'Stances' to 'Relationships'.";
public override string Description =>
"'Stances' in regards to a player have been renamed to 'Relationships'.\n" +
"The yaml values did not change.";
readonly (string TraitName, string OldName, string NewName)[] traits =
{

View File

@@ -15,14 +15,9 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
{
class RenameWithNukeLaunch : UpdateRule
{
public override string Name { get { return "Renamed WithNukeLaunchAnimation and Overlay"; } }
public override string Description
{
get
{
return "`WithNukeLaunchAnimation` has been renamed to `WithSupportPowerActivationAnimation` and `WithNukeLaunchOverlay` to `WithSupportPowerActivationOverlay`.";
}
}
public override string Name => "Renamed WithNukeLaunchAnimation and Overlay";
public override string Description => "`WithNukeLaunchAnimation` has been renamed to `WithSupportPowerActivationAnimation` and `WithNukeLaunchOverlay` to `WithSupportPowerActivationOverlay`.";
public override IEnumerable<string> UpdateActorNode(ModData modData, MiniYamlNode actorNode)
{

View File

@@ -15,14 +15,9 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
{
public class ReplaceBurns : UpdateRule
{
public override string Name { get { return "Replaced Burns with separate render and health change traits."; } }
public override string Description
{
get
{
return "Burns can be replaced using WithIdleOverlay and ChangesHealth.";
}
}
public override string Name => "Replaced Burns with separate render and health change traits.";
public override string Description => "Burns can be replaced using WithIdleOverlay and ChangesHealth.";
public override IEnumerable<string> UpdateActorNode(ModData modData, MiniYamlNode actorNode)
{

View File

@@ -56,7 +56,8 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
{ "Missile", new[] { "HorizontalRateOfTurn", "VerticalRateOfTurn" } }
};
public override string Name { get { return "Increase facing angle resolution"; } }
public override string Name => "Increase facing angle resolution";
public override string Description
{
get

View File

@@ -15,14 +15,9 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
{
class SpawnActorPowerDefaultEffect : UpdateRule
{
public override string Name { get { return "Set SpawnActorPower EffectSequence to it's previous default value."; } }
public override string Description
{
get
{
return "The 'EffectSequence' of 'SpawnActorPower' is unset by default.";
}
}
public override string Name => "Set SpawnActorPower EffectSequence to it's previous default value.";
public override string Description => "The 'EffectSequence' of 'SpawnActorPower' is unset by default.";
public override IEnumerable<string> UpdateActorNode(ModData modData, MiniYamlNode actorNode)
{

View File

@@ -15,14 +15,9 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
{
public class SplitDamagedByTerrain : UpdateRule
{
public override string Name { get { return "Several properties of 'DamagedByTerrain' have been moved to the new 'D2kBuilding' trait."; } }
public override string Description
{
get
{
return "'DamageThreshold' and 'StartOnThreshold' are no longer supported and removed from 'DamagedByTerrain'.";
}
}
public override string Name => "Several properties of 'DamagedByTerrain' have been moved to the new 'D2kBuilding' trait.";
public override string Description => "'DamageThreshold' and 'StartOnThreshold' are no longer supported and removed from 'DamagedByTerrain'.";
public override IEnumerable<string> UpdateActorNode(ModData modData, MiniYamlNode actorNode)
{

View File

@@ -15,7 +15,8 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
{
class UpdateMapInits : UpdateRule
{
public override string Name { get { return "Update map actor definitions"; } }
public override string Name => "Update map actor definitions";
public override string Description
{
get

View File

@@ -15,14 +15,9 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
{
class UpdateTilesetColors : UpdateRule
{
public override string Name { get { return "Rename Tileset LeftColor and RightColor"; } }
public override string Description
{
get
{
return "The LeftColor and RightColor keys in tilesets have been renamed to MinColor and MaxColor to reflect their proper usage.";
}
}
public override string Name => "Rename Tileset LeftColor and RightColor";
public override string Description => "The LeftColor and RightColor keys in tilesets have been renamed to MinColor and MaxColor to reflect their proper usage.";
public override IEnumerable<string> UpdateTilesetNode(ModData modData, MiniYamlNode tilesetNode)
{