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

@@ -16,7 +16,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[Desc("This actor receives damage from the given weapon when on the specified terrain type.")]
class DamagedByTerrainInfo : ConditionalTraitInfo, Requires<HealthInfo>
class DamagedByTerrainInfo : ConditionalTraitInfo, Requires<IHealthInfo>
{
[Desc("Amount of damage received per DamageInterval ticks.")]
[FieldLoader.Require] public readonly int Damage = 0;
@@ -41,14 +41,14 @@ namespace OpenRA.Mods.Common.Traits
class DamagedByTerrain : ConditionalTrait<DamagedByTerrainInfo>, ITick, ISync, INotifyAddedToWorld
{
readonly Health health;
readonly IHealth health;
[Sync] int damageTicks;
[Sync] int damageThreshold;
public DamagedByTerrain(Actor self, DamagedByTerrainInfo info) : base(info)
{
health = self.Trait<Health>();
health = self.Trait<IHealth>();
}
void INotifyAddedToWorld.AddedToWorld(Actor self)