Esempio n. 1
0
        internal Vector CalculateMoveToFollowTarget(Field <IAnimal> field)
        {
            var move     = _vectorMath.Normalize(_targetAntelope.Position - Position);
            var nextPos  = Position + move;
            var nextCell = field[nextPos.X, nextPos.Y];

            if (nextCell == _targetAntelope || nextCell == null)
            {
                return(move);
            }
            return(new Vector(0, 0));
        }