ace/Source/ACE.Server/Entity/DamageHistoryEntry.cs
gmriggs ef75ab6b79
minimizing DamageHistory.WeakReference (#2424)
* minimizing DamageHistory.WeakReference

* minor updates
2019-11-18 16:32:43 -05:00

39 lines
1.1 KiB
C#

using System;
using ACE.Entity;
using ACE.Entity.Enum;
using ACE.Server.WorldObjects;
namespace ACE.Server.Entity
{
public class DamageHistoryEntry
{
public ObjectGuid Attacker;
public DamageType DamageType;
public int Amount;
public uint CurrentHealth;
public uint MaxHealth;
public DateTime Time;
/// <summary>
/// Constructs a new entry for the DamageHistory
/// </summary>
/// <param name="attacker">The creature source of the damage. In the case of a projectile, this would be the Creature that launched the projectile.</param>
/// <param name="amount">A negative amount for damage taken, positive for healing</param>
public DamageHistoryEntry(Creature creature, ObjectGuid attacker, DamageType damageType, int amount)
{
Attacker = attacker;
DamageType = damageType;
Amount = amount;
CurrentHealth = creature.Health.Current;
MaxHealth = creature.Health.MaxValue;
Time = DateTime.UtcNow;
}
}
}