Пример #1
0
    public void DoGUI()
    {
        selectedGame = RGUI.Field(selectedGame, "Game");
        selectedAlgo = RGUI.Field(selectedAlgo, "Algo");

        if (selectedAlgo == Algo.MonteCarlo)
        {
            GUILayout.Label("Disable ES for more options.");
            mcES = RGUI.Field(mcES, "ES");
            if (!mcES)
            {
                mcOnPolicy   = RGUI.Field(mcOnPolicy, "On/Off Policy");
                mcFirstVisit = RGUI.Field(mcFirstVisit, "First/Every Visit");
            }
        }

        if (selectedGame == Game.Sokoban)
        {
            selectedSokobanLevel = RGUI.Field(selectedSokobanLevel, "Level");
        }

        if (elapsedMs != -1)
        {
            GUILayout.Label("In " + elapsedMs + " milliseconds");
        }
    }
Пример #2
0
    void Start()
    {
        oldGame         = Game.TicTacToe;
        oldAlgo         = Algo.MarkovValue;
        oldSokobanLevel = SokobanLevel.Easy;

        selectedGame         = Game.GridWorld;
        selectedAlgo         = Algo.MarkovValue;
        selectedSokobanLevel = SokobanLevel.Easy;

        mcES         = true;
        mcOnPolicy   = false;
        mcFirstVisit = false;

        btnComponent = playButton.GetComponent <Button>();
    }
Пример #3
0
        ///<summary>Copy whole level (source level)</summary>
        public void CopyFrom(SokobanLevel uSourceLevel)
        {
            //Reinitialize level
            SetSize(uSourceLevel.iXsize, uSourceLevel.iYsize);

            //Copy all cells from source
            for (int i = 0; i < uSourceLevel.iXsize; i++)
                for (int j = 0; j < uSourceLevel.iYsize; j++)
                    bCells[i, j] = uSourceLevel.bCells[i, j];
            // (Is there any memcpy-like way for this?)

            //Copy other parameters of level
            uBestMovesSolution = uSourceLevel.uBestMovesSolution;
            uBestPushesSolution = uSourceLevel.uBestPushesSolution;
            bSolved = uSourceLevel.bSolved;
            sTitle = uSourceLevel.sTitle;
            sAuthor = uSourceLevel.sAuthor;
            sComment = uSourceLevel.sComment;
        }
Пример #4
0
 ///<summary>Copy-constructor for fast creation of temprorary levels (source level)</summary>
 public SokobanLevel(SokobanLevel uLevelToCopy)
 {
     CopyFrom(uLevelToCopy);
 }