コード例 #1
0
    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