Refactored Health usage to IHealth.

This commit is contained in:
Andre Mohren
2018-09-27 02:02:08 +02:00
committed by reaperrr
parent 83cd7cf485
commit 640078a2b1
30 changed files with 68 additions and 61 deletions

View File

@@ -14,20 +14,20 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[Desc("Scale power amount with the current health.")]
public class ScalePowerWithHealthInfo : ITraitInfo, Requires<PowerInfo>, Requires<HealthInfo>
public class ScalePowerWithHealthInfo : ITraitInfo, Requires<PowerInfo>, Requires<IHealthInfo>
{
public object Create(ActorInitializer init) { return new ScalePowerWithHealth(init.Self); }
}
public class ScalePowerWithHealth : IPowerModifier, INotifyDamage, INotifyOwnerChanged
{
readonly Health health;
readonly IHealth health;
PowerManager power;
public ScalePowerWithHealth(Actor self)
{
power = self.Owner.PlayerActor.Trait<PowerManager>();
health = self.Trait<Health>();
health = self.Trait<IHealth>();
}
int IPowerModifier.GetPowerModifier()