Exemplo n.º 1
0
 public void Start()
 {
     if (solver == null)
     {
         PrepareForStart();
     }
     if (mazeForm != null)
     {
         mazeForm.UpdateCaption();
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Paints the contents of this control by rendering the GraphicsBuffer.
        /// </summary>
        /// <param name="e"></param>
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);

            // Use a larger grid width for the first maze.
            if (this.wallWidth < 0)
            {
                this.Setup(12, 3, 8);
            }

            painter.OnPaint(this.PaintImages);

            // If a new maze has been painted, the caption needs to be updated.
            if (MazeForm != null)
            {
                MazeForm.UpdateCaption();
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Take all modifyable parameters from the given data object.
        /// </summary>
        /// <param name="data"></param>
        public void TakeParametersFrom(AriadneSettingsData data)
        {
            this.settingsData = data;

            painter.TakeParametersFrom(data);

            // Destroy the current image loader (in case the parameters have changed).
            this.imageLoader = null;

            #region Do the equivalent of Setup() with the modified parameters.

            // CreateMaze()
            MazeForm.MakeReservedAreas(Maze);
            this.ReserveAreasForImages(data);
            this.AddOutlineShape(data);
            Maze.CreateMaze();
            Reset();

            #endregion

            mazeForm.UpdateStatusLine();
            mazeForm.UpdateCaption();
        }