Ejemplo n.º 1
0
        /// <summary>
        /// opens the map editor for a new maze
        /// </summary>
        /// <param name="screenBuffer"></param>
        private void CreateNewMazeScreen(ScreenBuffer screenBuffer)
        {
            // Stop the menu from rendering
            screenBuffer.ClearRenderQueue();
            screenBuffer.ClearBuffer();

            // TODO: Add a user input for the name of a maze

            // create a new maze editor with a new maze
            // and show it
            _mazeEditor = new MazeEditor("");
            _mazeEditor.Show(screenBuffer);
        }
Ejemplo n.º 2
0
        private void EditExistingMaze(ScreenBuffer screenBuffer)
        {
            // load the maze from the file
            var fileStream      = File.OpenRead(_editMazePath);
            var binaryFormatter = new BinaryFormatter();
            var mazeToEdit      = (Maze.Maze)binaryFormatter.Deserialize(fileStream);

            fileStream.Dispose();
            fileStream.Close();

            // stop the existing rendering
            screenBuffer.ClearRenderQueue();
            screenBuffer.ClearBuffer();

            // load the editor with that maze
            _mazeEditor = new MazeEditor(mazeToEdit);
            _mazeEditor.Show(screenBuffer);
        }