Make IPowerModifier require explicit implementation

Plus some 'collateral' explicit implementations on the affected traits.
This commit is contained in:
reaperrr
2016-10-22 22:13:08 +02:00
parent 2d0560dcb7
commit ad6ea52bff
5 changed files with 15 additions and 10 deletions

View File

@@ -30,13 +30,14 @@ namespace OpenRA.Mods.Common.Traits
health = self.Trait<Health>();
}
public int GetPowerModifier()
int IPowerModifier.GetPowerModifier()
{
return 100 * health.HP / health.MaxHP;
}
public void Damaged(Actor self, AttackInfo e) { power.UpdateActor(self); }
public void OnOwnerChanged(Actor self, Player oldOwner, Player newOwner)
void INotifyDamage.Damaged(Actor self, AttackInfo e) { power.UpdateActor(self); }
void INotifyOwnerChanged.OnOwnerChanged(Actor self, Player oldOwner, Player newOwner)
{
power = newOwner.PlayerActor.Trait<PowerManager>();
}