Ejemplo n.º 1
0
        private bool IsValidPath(IntVector2 targetPosition, List <IntVector2> path)
        {
            if (path.Count == 0)
            {
                NoWayToDestination?.Invoke(targetPosition);
                return(false);
            }

            return(true);
        }
Ejemplo n.º 2
0
        private bool IsPositionOccupated(IntVector2 nextPosition)
        {
            if (!_occupatedPossitionsMap.IsVacantPosition(nextPosition))
            {
                _nextOccupiedPossition = nextPosition;

                if (_nextOccupiedPossition.Equals(_destination))
                {
                    NoWayToDestination?.Invoke(_nextOccupiedPossition);
                }
                else
                {
                    NextTileOccupied?.Invoke(_nextOccupiedPossition);
                }

                return true;
            }

            return false;
        }
Ejemplo n.º 3
0
 public void RiseNoWayToDestination(IntVector2 occupiedPositin)
 {
     NoWayToDestination?.Invoke(occupiedPositin);
 }