internal static TargetProperties EvaluateUnitProperties(CacheUnit unit)
{
TargetProperties properties = TargetProperties.None;
if (unit.IsBoss)
properties |= TargetProperties.Boss;
if (unit.IsBurrowableUnit)
properties |= TargetProperties.Burrowing;
if (unit.MonsterMissileDampening)
properties |= TargetProperties.MissileDampening;
if (unit.IsMissileReflecting)
properties |= TargetProperties.MissileReflecting;
if (unit.MonsterShielding)
properties |= TargetProperties.Shielding;
if (unit.IsStealthableUnit)
properties |= TargetProperties.Stealthable;
if (unit.IsSucideBomber)
properties |= TargetProperties.SucideBomber;
if (unit.IsTreasureGoblin)
properties |= TargetProperties.TreasureGoblin;
if (unit.IsFast)
properties |= TargetProperties.Fast;
if (unit.IsEliteRareUnique)
properties |= TargetProperties.RareElite;
if (unit.MonsterUnique)
properties |= TargetProperties.Unique;
if (unit.CurrentHealthPct.HasValue && unit.CurrentHealthPct.Value == 1d)
properties |= TargetProperties.FullHealth;
if (unit.UnitMaxHitPointAverageWeight < 0)
properties |= TargetProperties.Weak;
if (unit.IsRanged)
properties |= TargetProperties.Ranged;
if (unit.IsTargetableAndAttackable)
properties |= TargetProperties.TargetableAndAttackable;
if (unit.HasDOTdps.HasValue && unit.HasDOTdps.Value)
properties |= TargetProperties.DOTDPS;
if (unit.RadiusDistance < 10f)
properties |= TargetProperties.CloseDistance;
if (unit.MonsterReflectDamage)
properties |= TargetProperties.ReflectsDamage;
if (unit.MonsterElectrified)
properties |= TargetProperties.Electrified;
if (unit.MonsterNormal)
properties |= TargetProperties.Normal;
if (unit.CurrentHealthPct.HasValue && unit.CurrentHealthPct.Value < 0.25d)
properties |= TargetProperties.LowHealth;
return properties;
}