private void SpawnGoal(MapSquare firstSquare)
    {
        MapSquare[]      allSquares    = FindObjectsOfType <MapSquare>();
        List <MapSquare> activeSquares = new List <MapSquare>();

        // get the distance for each square
        foreach (MapSquare square in allSquares)
        {
            if (square.IsActive())
            {
                square.SetTemporaryPositionMeasurement(firstSquare.GetDistanceToTargetSquare(square));
                activeSquares.Add(square);
            }
        }

        activeSquares.Sort(SortByDistance);
        int longestDistance = activeSquares[activeSquares.Count - 1].GetDistanceMeasurement();

        // then narrow down our options to distance = the most, or distance = the most - 1
        List <MapSquare> potentialGoalSquares = new List <MapSquare>();

        foreach (MapSquare square in activeSquares)
        {
            if (square.GetDistanceMeasurement() >= longestDistance - 1)
            {
                potentialGoalSquares.Add(square);
            }
        }

        potentialGoalSquares[Random.Range(0, potentialGoalSquares.Count)].SetGoalSquare();
    }
    private MapSquare SetExtractionPoint()
    {
        MapSquare[]      allSquares    = FindObjectsOfType <MapSquare>();
        List <MapSquare> activeSquares = new List <MapSquare>();

        // get the distance for each square
        foreach (MapSquare square in allSquares)
        {
            if (square.IsActive())
            {
                square.SetTemporaryPositionMeasurement(currentSquare.GetDistanceToTargetSquare(square));
                activeSquares.Add(square);
            }
        }

        activeSquares.Sort(SortByDistance);
        int longestDistance = activeSquares[activeSquares.Count - 1].GetDistanceMeasurement();

        // then narrow down our options to distance = the most, or distance = the most - 1
        List <MapSquare> potentialExtractionSquares = new List <MapSquare>();

        foreach (MapSquare square in activeSquares)
        {
            if (square.GetDistanceMeasurement() >= longestDistance - 1)
            {
                potentialExtractionSquares.Add(square);
            }
        }

        MapSquare extractionSquare = potentialExtractionSquares[Random.Range(0, potentialExtractionSquares.Count)];

        return(extractionSquare);
    }