Beispiel #1
0
    void TestAdjSquares()
    {
        int x = 0, y = 0;

        (List <int> adjx, List <int> adjy) = FlowerGrid.getAdjacentSquares(x, y);
        Debug.Log(String.Format("{1} {2} ---- {0}", PointsToString(adjx, adjy), x, y));

        (x, y)       = (FlowerGrid.GRIDWIDTH - 1, 7);
        (adjx, adjy) = FlowerGrid.getAdjacentSquares(x, y);
        Debug.Log(String.Format("{1} {2} ---- {0}", PointsToString(adjx, adjy), x, y));

        (x, y)       = (4, FlowerGrid.GRIDHEIGHT - 1);
        (adjx, adjy) = FlowerGrid.getAdjacentSquares(x, y);
        Debug.Log(String.Format("{1} {2} ---- {0}", PointsToString(adjx, adjy), x, y));

        (x, y)       = (2, 9);
        (adjx, adjy) = FlowerGrid.getAdjacentSquares(x, y);
        Debug.Log(String.Format("{1} {2} ---- {0}", PointsToString(adjx, adjy), x, y));

        (x, y)       = (0, 9);
        (adjx, adjy) = FlowerGrid.getAdjacentSquares(x, y);
        Debug.Log(String.Format("{1} {2} ---- {0}", PointsToString(adjx, adjy), x, y));

        (x, y)       = (0, FlowerGrid.GRIDHEIGHT - 1);
        (adjx, adjy) = FlowerGrid.getAdjacentSquares(x, y);
        Debug.Log(String.Format("{1} {2} ---- {0}", PointsToString(adjx, adjy), x, y));

        (x, y)       = (FlowerGrid.GRIDWIDTH - 1, FlowerGrid.GRIDHEIGHT - 1);
        (adjx, adjy) = FlowerGrid.getAdjacentSquares(x, y);
        Debug.Log(String.Format("{1} {2} ---- {0}", PointsToString(adjx, adjy), x, y));
    }
Beispiel #2
0
 private void Awake()
 {
     flowerGrid = this;
     InitialiseGrid();
 }