From 97c2c24e8ddc33488ee681a7ccb499dd6f53b051 Mon Sep 17 00:00:00 2001 From: reaperrr Date: Sat, 22 Oct 2016 19:34:39 +0200 Subject: [PATCH] Require explicit implementation of IDamageModifier --- OpenRA.Mods.Cnc/Traits/AttackPopupTurreted.cs | 2 +- OpenRA.Mods.Common/Traits/Infantry/TerrainModifiesDamage.cs | 2 +- OpenRA.Mods.Common/Traits/Multipliers/DamageMultiplier.cs | 2 +- OpenRA.Mods.Common/TraitsInterfaces.cs | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/OpenRA.Mods.Cnc/Traits/AttackPopupTurreted.cs b/OpenRA.Mods.Cnc/Traits/AttackPopupTurreted.cs index 1feba5c954..e8619bf553 100644 --- a/OpenRA.Mods.Cnc/Traits/AttackPopupTurreted.cs +++ b/OpenRA.Mods.Cnc/Traits/AttackPopupTurreted.cs @@ -112,7 +112,7 @@ namespace OpenRA.Mods.Cnc.Traits } } - public int GetDamageModifier(Actor attacker, Damage damage) + int IDamageModifier.GetDamageModifier(Actor attacker, Damage damage) { return state == PopupState.Closed ? info.ClosedDamageMultiplier : 100; } diff --git a/OpenRA.Mods.Common/Traits/Infantry/TerrainModifiesDamage.cs b/OpenRA.Mods.Common/Traits/Infantry/TerrainModifiesDamage.cs index c06d4a2262..185cfb7880 100644 --- a/OpenRA.Mods.Common/Traits/Infantry/TerrainModifiesDamage.cs +++ b/OpenRA.Mods.Common/Traits/Infantry/TerrainModifiesDamage.cs @@ -41,7 +41,7 @@ namespace OpenRA.Mods.Common.Traits this.self = self; } - public int GetDamageModifier(Actor attacker, Damage damage) + int IDamageModifier.GetDamageModifier(Actor attacker, Damage damage) { if (attacker.Owner.IsAlliedWith(self.Owner) && damage.Value < 0 && !Info.ModifyHealing) return FullDamage; diff --git a/OpenRA.Mods.Common/Traits/Multipliers/DamageMultiplier.cs b/OpenRA.Mods.Common/Traits/Multipliers/DamageMultiplier.cs index 87b107fe06..6ba58d0921 100644 --- a/OpenRA.Mods.Common/Traits/Multipliers/DamageMultiplier.cs +++ b/OpenRA.Mods.Common/Traits/Multipliers/DamageMultiplier.cs @@ -26,6 +26,6 @@ namespace OpenRA.Mods.Common.Traits public DamageMultiplier(DamageMultiplierInfo info, string actorType) : base(info, "DamageMultiplier", actorType) { } - public int GetDamageModifier(Actor attacker, Damage damage) { return GetModifier(); } + int IDamageModifier.GetDamageModifier(Actor attacker, Damage damage) { return GetModifier(); } } } diff --git a/OpenRA.Mods.Common/TraitsInterfaces.cs b/OpenRA.Mods.Common/TraitsInterfaces.cs index 4bcf3f9bbb..357a73e954 100644 --- a/OpenRA.Mods.Common/TraitsInterfaces.cs +++ b/OpenRA.Mods.Common/TraitsInterfaces.cs @@ -203,6 +203,7 @@ namespace OpenRA.Mods.Common.Traits string SequencePrefix { get; } } + [RequireExplicitImplementation] public interface IDamageModifier { int GetDamageModifier(Actor attacker, Damage damage); } public interface ISpeedModifier { int GetSpeedModifier(); } public interface IFirepowerModifier { int GetFirepowerModifier(); }