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
{
public class HealthInfo : ITraitInfo, UsesInit<HealthInit>, IRulesetLoaded
public class HealthInfo : IHealthInfo, UsesInit<HealthInit>, IRulesetLoaded
{
[Desc("HitPoints")]
public readonly int HP = 0;
@@ -30,6 +30,8 @@ namespace OpenRA.Mods.Common.Traits
if (!ai.HasTraitInfo<HitShapeInfo>())
throw new YamlException("Actors with Health need at least one HitShape trait!");
}
int IHealthInfo.MaxHP { get { return HP; } }
}
public class Health : IHealth, ISync, ITick, INotifyCreated, INotifyOwnerChanged