private void playPanelPaint(object sender, PaintEventArgs e) { if (SokobanProgram.GetGameManager().IsMapCreated()) { SokobanProgram.GetGameManager().GetGameMap().DrawMap(e.Graphics); } }
/// <summary> /// The event called when the grid panel is clicked. /// </summary> /// <param name="sender">The object sender.</param> /// <param name="e">The mouse event arguments.</param> private void GridMouseClick(object sender, MouseEventArgs e) { if (SokobanProgram.GetGameManager().IsMapCreated()) { SokobanProgram.GetGameManager().GetGameMap().Click(e); } }
/// <summary> /// The method called when the generate button is clicked. /// </summary> /// <param name="sender">The object sender.</param> /// <param name="e">The event arguments.</param> private void GenerateButton_Click(object sender, EventArgs e) { if (SokobanProgram.GetGameManager().IsMapCreated()) { DialogResult dialogResult = MessageBox.Show("Do you want to create a new map? The changes wont be saved for this one. Click file -> save to save changes.", "Do you want to create a new map?", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.No) { return; } } int rows = (int)RowCountButton.Value; int columns = (int)ColumnCountButton.Value; if (rows > 27 || columns > 16) { MessageBox.Show("You can't have more than 27 rows or more than 16 columns."); return; } SokobanProgram.GetGameManager().CreateMap(rows, columns); Invalidate(); }
/// <summary> /// The method called on clicking the play button. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The event arguments.</param> private void PlayButton_Click(object sender, EventArgs e) { SokobanProgram.OpenGameState(GameState.PLAY); }
/// <summary> /// The method called on clicking the design button. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The event arguments.</param> private void DesignButton_Click(object sender, EventArgs e) { SokobanProgram.OpenGameState(GameState.DESIGN); }
private void handleMoveClick(Direction direction) { SokobanProgram.GetGameManager().GetGameMap().HandleMoveClick(direction); }
private void exitToolStripMenuItem1_Click(object sender, EventArgs e) { SokobanProgram.GetGameManager().Unload(); SokobanProgram.OpenGameState(GameState.SELECTION); }