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

@@ -15,7 +15,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[Desc("Attach this to actors which should be able to regenerate their health points.")]
class SelfHealingInfo : ConditionalTraitInfo, Requires<HealthInfo>
class SelfHealingInfo : ConditionalTraitInfo, Requires<IHealthInfo>
{
[Desc("Absolute amount of health points added in each step.")]
public readonly int Step = 5;
@@ -39,7 +39,7 @@ namespace OpenRA.Mods.Common.Traits
class SelfHealing : ConditionalTrait<SelfHealingInfo>, ITick, INotifyDamage
{
readonly Health health;
readonly IHealth health;
[Sync] int ticks;
[Sync] int damageTicks;
@@ -47,7 +47,7 @@ namespace OpenRA.Mods.Common.Traits
public SelfHealing(Actor self, SelfHealingInfo info)
: base(info)
{
health = self.Trait<Health>();
health = self.Trait<IHealth>();
}
void ITick.Tick(Actor self)