private void UpdateCurrentState()
        {
            var allCellsOK = true;

            for (int i = 0; i < Background.Columns; ++i)
            {
                for (int j = 0; j < Background.Rows; ++j)
                {
                    allCellsOK &= CellCorrect(i, j);

                    if (!allCellsOK)
                    {
                        break;
                    }
                }
            }

            if (allCellsOK)
            {
                CurrentState = LevelPlayState.Won;
            }
            else
            {
                CurrentState = Statistics.MovesStarted > 0 ? LevelPlayState.Ongoing : LevelPlayState.Unstarted;
            }
        }
Exemple #2
0
 public void SetLevelPlayState(LevelPlayState newState)
 {
     this.state = newState;
 }