diff --git a/OpenRA.Game/Fonts.cs b/OpenRA.Game/Fonts.cs index 6a1109e2bc..d7c1d28ff0 100644 --- a/OpenRA.Game/Fonts.cs +++ b/OpenRA.Game/Fonts.cs @@ -22,7 +22,7 @@ namespace OpenRA public class Fonts : IGlobalModData { - [FieldLoader.LoadUsing("LoadFonts")] + [FieldLoader.LoadUsing(nameof(LoadFonts))] public readonly Dictionary FontList; static object LoadFonts(MiniYaml y) diff --git a/OpenRA.Game/GameRules/WeaponInfo.cs b/OpenRA.Game/GameRules/WeaponInfo.cs index 683bbf4608..cc706231e5 100644 --- a/OpenRA.Game/GameRules/WeaponInfo.cs +++ b/OpenRA.Game/GameRules/WeaponInfo.cs @@ -121,10 +121,10 @@ namespace OpenRA.GameRules [Desc("Does this weapon aim at the target's center regardless of other targetable offsets?")] public readonly bool TargetActorCenter = false; - [FieldLoader.LoadUsing("LoadProjectile")] + [FieldLoader.LoadUsing(nameof(LoadProjectile))] public readonly IProjectileInfo Projectile; - [FieldLoader.LoadUsing("LoadWarheads")] + [FieldLoader.LoadUsing(nameof(LoadWarheads))] public readonly List Warheads = new List(); public WeaponInfo(string name, MiniYaml content) diff --git a/OpenRA.Game/GameSpeed.cs b/OpenRA.Game/GameSpeed.cs index 2316a4120b..f10c071b6b 100644 --- a/OpenRA.Game/GameSpeed.cs +++ b/OpenRA.Game/GameSpeed.cs @@ -22,7 +22,7 @@ namespace OpenRA public class GameSpeeds : IGlobalModData { - [FieldLoader.LoadUsing("LoadSpeeds")] + [FieldLoader.LoadUsing(nameof(LoadSpeeds))] public readonly Dictionary Speeds; static object LoadSpeeds(MiniYaml y) diff --git a/OpenRA.Game/Network/GameServer.cs b/OpenRA.Game/Network/GameServer.cs index 4468beaf38..f0f914a2e7 100644 --- a/OpenRA.Game/Network/GameServer.cs +++ b/OpenRA.Game/Network/GameServer.cs @@ -129,7 +129,7 @@ namespace OpenRA.Network [FieldLoader.Ignore] public readonly bool IsJoinable = false; - [FieldLoader.LoadUsing("LoadClients")] + [FieldLoader.LoadUsing(nameof(LoadClients))] public readonly GameClient[] Clients; /// The list of spawnpoints that are disabled for this game diff --git a/OpenRA.Game/PlayerProfile.cs b/OpenRA.Game/PlayerProfile.cs index acc81bdc5f..82b04fe481 100644 --- a/OpenRA.Game/PlayerProfile.cs +++ b/OpenRA.Game/PlayerProfile.cs @@ -24,7 +24,7 @@ namespace OpenRA public readonly string ProfileName; public readonly string ProfileRank = "Registered Player"; - [FieldLoader.LoadUsing("LoadBadges")] + [FieldLoader.LoadUsing(nameof(LoadBadges))] public readonly List Badges; static object LoadBadges(MiniYaml yaml) diff --git a/OpenRA.Mods.Common/ModContent.cs b/OpenRA.Mods.Common/ModContent.cs index aba333d3e4..c4ecf0c732 100644 --- a/OpenRA.Mods.Common/ModContent.cs +++ b/OpenRA.Mods.Common/ModContent.cs @@ -91,7 +91,7 @@ namespace OpenRA public readonly string HeaderMessage; public readonly string ContentInstallerMod = "modcontent"; - [FieldLoader.LoadUsing("LoadPackages")] + [FieldLoader.LoadUsing(nameof(LoadPackages))] public readonly Dictionary Packages = new Dictionary(); static object LoadPackages(MiniYaml yaml) @@ -105,7 +105,7 @@ namespace OpenRA return packages; } - [FieldLoader.LoadUsing("LoadDownloads")] + [FieldLoader.LoadUsing(nameof(LoadDownloads))] public readonly string[] Downloads = { }; static object LoadDownloads(MiniYaml yaml) @@ -114,7 +114,7 @@ namespace OpenRA return downloadNode != null ? downloadNode.Value.Nodes.Select(n => n.Key).ToArray() : new string[0]; } - [FieldLoader.LoadUsing("LoadSources")] + [FieldLoader.LoadUsing(nameof(LoadSources))] public readonly string[] Sources = { }; static object LoadSources(MiniYaml yaml) diff --git a/OpenRA.Mods.Common/Traits/BotModules/BotModuleLogic/SupportPowerDecision.cs b/OpenRA.Mods.Common/Traits/BotModules/BotModuleLogic/SupportPowerDecision.cs index e46b2d9143..7a118b338d 100644 --- a/OpenRA.Mods.Common/Traits/BotModules/BotModuleLogic/SupportPowerDecision.cs +++ b/OpenRA.Mods.Common/Traits/BotModules/BotModuleLogic/SupportPowerDecision.cs @@ -30,7 +30,7 @@ namespace OpenRA.Mods.Common.Traits [Desc("What is the fine scan radius of this power?", "For doing a detailed scan in the general target area.", "Minimum is 1")] public readonly int FineScanRadius = 2; - [FieldLoader.LoadUsing("LoadConsiderations")] + [FieldLoader.LoadUsing(nameof(LoadConsiderations))] [Desc("The decisions associated with this power")] public readonly List Considerations = new List(); diff --git a/OpenRA.Mods.Common/Traits/BotModules/SupportPowerBotModule.cs b/OpenRA.Mods.Common/Traits/BotModules/SupportPowerBotModule.cs index 8986eff4cf..ac23a5c61f 100644 --- a/OpenRA.Mods.Common/Traits/BotModules/SupportPowerBotModule.cs +++ b/OpenRA.Mods.Common/Traits/BotModules/SupportPowerBotModule.cs @@ -19,7 +19,7 @@ namespace OpenRA.Mods.Common.Traits public class SupportPowerBotModuleInfo : ConditionalTraitInfo, Requires { [Desc("Tells the AI how to use its support powers.")] - [FieldLoader.LoadUsing("LoadDecisions")] + [FieldLoader.LoadUsing(nameof(LoadDecisions))] public readonly List Decisions = new List(); static object LoadDecisions(MiniYaml yaml) diff --git a/OpenRA.Mods.Common/Traits/Buildings/Building.cs b/OpenRA.Mods.Common/Traits/Buildings/Building.cs index b26164c351..5a371814f4 100644 --- a/OpenRA.Mods.Common/Traits/Buildings/Building.cs +++ b/OpenRA.Mods.Common/Traits/Buildings/Building.cs @@ -33,7 +33,7 @@ namespace OpenRA.Mods.Common.Traits [Desc("x means cell is blocked, capital X means blocked but not counting as targetable, ", "= means part of the footprint but passable, _ means completely empty.")] - [FieldLoader.LoadUsing("LoadFootprint")] + [FieldLoader.LoadUsing(nameof(LoadFootprint))] public readonly Dictionary Footprint; public readonly CVec Dimensions = new CVec(1, 1); diff --git a/OpenRA.Mods.Common/Traits/HitShape.cs b/OpenRA.Mods.Common/Traits/HitShape.cs index 903e9f1634..f590d3c819 100644 --- a/OpenRA.Mods.Common/Traits/HitShape.cs +++ b/OpenRA.Mods.Common/Traits/HitShape.cs @@ -34,7 +34,7 @@ namespace OpenRA.Mods.Common.Traits "If none specified, all armor types the actor has are valid.")] public readonly BitSet ArmorTypes = default(BitSet); - [FieldLoader.LoadUsing("LoadShape")] + [FieldLoader.LoadUsing(nameof(LoadShape))] [Desc("Engine comes with support for `Circle`, `Capsule`, `Polygon` and `Rectangle`. Defaults to `Circle` when left empty.")] public readonly IHitShape Type; diff --git a/OpenRA.Mods.Common/Traits/World/Locomotor.cs b/OpenRA.Mods.Common/Traits/World/Locomotor.cs index c651e11d22..18c99cd825 100644 --- a/OpenRA.Mods.Common/Traits/World/Locomotor.cs +++ b/OpenRA.Mods.Common/Traits/World/Locomotor.cs @@ -76,7 +76,7 @@ namespace OpenRA.Mods.Common.Traits [Desc("Types of damage that are caused while crushing. Leave empty for no damage types.")] public readonly BitSet CrushDamageTypes = default(BitSet); - [FieldLoader.LoadUsing("LoadSpeeds", true)] + [FieldLoader.LoadUsing(nameof(LoadSpeeds), true)] [Desc("Lower the value on rough terrain. Leave out entries for impassable terrain.")] public readonly Dictionary TerrainSpeeds; diff --git a/OpenRA.Mods.Common/Traits/World/SmudgeLayer.cs b/OpenRA.Mods.Common/Traits/World/SmudgeLayer.cs index 3cd090e41a..c053a3d1c7 100644 --- a/OpenRA.Mods.Common/Traits/World/SmudgeLayer.cs +++ b/OpenRA.Mods.Common/Traits/World/SmudgeLayer.cs @@ -49,7 +49,7 @@ namespace OpenRA.Mods.Common.Traits [PaletteReference] public readonly string Palette = TileSet.TerrainPaletteInternalName; - [FieldLoader.LoadUsing("LoadInitialSmudges")] + [FieldLoader.LoadUsing(nameof(LoadInitialSmudges))] public readonly Dictionary InitialSmudges; public static object LoadInitialSmudges(MiniYaml yaml)