示例#1
0
        private static bool InGuardDistance(Combat.HitDefinition hitdef, Combat.Entity attacker, Combat.Character target)
        {
            if (attacker == null)
            {
                throw new ArgumentNullException(nameof(attacker));
            }
            if (target == null)
            {
                throw new ArgumentNullException(nameof(target));
            }
            if (hitdef == null)
            {
                throw new ArgumentNullException(nameof(hitdef));
            }

            var distance = Math.Abs(attacker.CurrentLocation.X - target.CurrentLocation.X);

            return(distance <= hitdef.GuardDistance);
        }
示例#2
0
        static Boolean InGuardDistance(Combat.HitDefinition hitdef, Combat.Entity attacker, Combat.Character target)
        {
            if (attacker == null)
            {
                throw new ArgumentNullException("attacker");
            }
            if (target == null)
            {
                throw new ArgumentNullException("target");
            }
            if (hitdef == null)
            {
                throw new ArgumentNullException("hitdef");
            }

            Single distance = Math.Abs(attacker.CurrentLocation.X - target.CurrentLocation.X);

            return(distance <= hitdef.GuardDistance);
        }