public void StartSolving( MapLayout _initialLayout, Scorer _scorer ) { StopSolving(); m_initialLayout = _initialLayout.Duplicate(); m_initialLayout.FloodFillAreas(); m_scorer = _scorer; m_numIterations = 0; m_bestSolution = new Solution(){ EmptySpaces = m_initialLayout.NumEmptySpaces, Score = 0, GameScore = 0, }; m_scorer.ScoreLayout( m_initialLayout, out m_bestSolution.Score, out m_bestSolution.GameScore ); m_solveCo = StartCoroutine( RunSolve_MonteCarlo() ); } // Start
private void Playback_ClearTileUnderCursor() { // Clear the history from this point onwards: if (m_playbackIndex < m_playbackLayouts.Count - 1) { m_playbackLayouts.RemoveRange(m_playbackIndex + 1, m_playbackLayouts.Count - m_playbackIndex - 1); } // Apply the change and story it in the play history: MapLayout nextLayout = m_playbackLayouts[m_playbackIndex].Duplicate(); nextLayout.FloodFillAreas(); int areaID = nextLayout.GetAreaID(m_cursorX, m_cursorY); if (areaID != Constants.Area_Invalid) { nextLayout.RemoveArea(areaID); m_playbackLayouts.Add(nextLayout); ++m_playbackIndex; UpdateMapVisuals(nextLayout, true); UpdatePlaybackText(); } } // Playback_ClearTileUnderCursor