void Start()
    {
        Debug.Log("test xxx");

        parallelGrain = 64;

        ColumnCount = gridSize;
        RowCount    = gridSize;
        RawCount    = ColumnCount * RowCount;

        _pauseDropDownComponent = pausedDropdown.GetComponentInChildren <TMP_Dropdown>();

        _tickerActive  = false;
        _mirrorDisplay = true;

        //enable ticker logic
        Ticker.OnTick += delegate(object sender, Ticker.OnTickArgs args)
        {
            if (_tickerActive)
            {
                TickForwardConwayState();

                UpdateDisplay();
            }
        };

        InitializeAll();

        CenterBrush(BrushFactory.GliderGun());

        UpdateDisplay();
    }
    private void SetTestCells()
    {
        //setBrushAt(0, 1, BrushFactory.singleCell());
        //setBrushAt(5, 1, BrushFactory.singleCell());
        //setBrushAt(10, 1, BrushFactory.singleCell());
        //        setBrushAt(0, 0, BrushFactory.solidThreeBlock());
        //       setBrushAt(10, 11, BrushFactory.singleCell());

        /*
         * setBrushAt(0, 0, BrushFactory.simpleGlider());
         * setBrushAt(0, 5, BrushFactory.simpleGlider());
         * setBrushAt(5, 0, BrushFactory.simpleGlider());
         * setBrushAt(5, 5, BrushFactory.simpleGlider());
         * setBrushAt(10, 0, BrushFactory.simpleGlider());
         * setBrushAt(0, 10, BrushFactory.simpleGlider());
         * setBrushAt(10, 5, BrushFactory.simpleGlider());
         * setBrushAt(5, 10, BrushFactory.simpleGlider());
         * setBrushAt(10, 0, BrushFactory.simpleGlider());
         * setBrushAt(10, 10, BrushFactory.simpleGlider());
         */
        //       setBrushAt(64, 3, BrushFactory.acorn());
        //          setBrushAt(30, 25, BrushFactory.RPentomino());
        //        setBrushAt(5, 3, BrushFactory.Blinker());
        SetBrushAt(64, 64, BrushFactory.GliderGun());
    }
Esempio n. 3
0
    public void HandleInputData(int choice)
    {
        switch (choice)
        {
        case 0:
//                Debug.Log("Glider Gun");
            main.ClearMap();
            main.CenterBrush(BrushFactory.GliderGun());
            main.UpdateDisplay();
            break;

        case 1:
            Debug.Log("Simple Glider");
            main.ClearMap();
            main.CenterBrush(BrushFactory.SimpleGlider());
            main.UpdateDisplay();
            break;

        case 2:
            Debug.Log("Tiled Glider");
            main.ClearMap();
            CellOffset[] tempBrush = BrushFactory.SimpleGlider();
            main.SetBrushAt(0, 0, BrushFactory.TiledBrush(main.ColumnCount, main.RowCount, 3, BrushFactory.SimpleGlider()));
            main.UpdateDisplay();
            break;

        case 3:
            Debug.Log("RPentimeno");
            main.ClearMap();
            main.CenterBrush(BrushFactory.RPentomino());
            main.UpdateDisplay();
            break;

        case 4:
            Debug.Log("Acorn");
            main.ClearMap();
            main.CenterBrush(BrushFactory.Acorn());
            main.UpdateDisplay();
            break;

        case 5:
            Debug.Log("Randomize");
            main.RandomizeState();
            main.UpdateDisplay();
            break;

        case 6:
            Debug.Log("Clear Map");
            main.ClearMap();
            main.UpdateDisplay();
            break;
        }
    }