Make IPowerModifier require explicit implementation
Plus some 'collateral' explicit implementations on the affected traits.
This commit is contained in:
@@ -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>();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user