private void neuesSpielToolStripMenuItem_Click(object sender, EventArgs e) { if (MessageBox.Show(this, "Sind Sie sich sicher, dass Sie das aktuelle Spiel abbrechen und ein neues Spiel starten möchten?", "Neues Spiel?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes) { Spider.Class.Game.Mode currentMode = Class.Game.Mode.OneSuit; using (ModeDialog mld = new ModeDialog()) { if (mld.ShowDialog(this) == DialogResult.OK) { currentMode = mld.SelectedMode; } } this.currentGame.MStructures.Clear(); this.currentGame.OtherCards.Clear(); this.Controls.Remove(this.currentRenderer); this.currentGame = new Class.Game(this, currentMode); this.currentGame.Refresh += CurrentGame_Refresh; this.currentGame.ReDraw += CurrentGame_ReDraw; this.currentRenderer.OnDraw(); if (this.info.HW_ACC) { this.currentRenderer = new Spider.Class.Render.SlimDXRenderer(); } else { this.currentRenderer = new Spider.Class.Render.GDIRenderer(); } this.currentRenderer.MouseDown += CurrentRenderer_MouseDown; currentRenderer.OnInit(this.currentGame, this, this.info); currentRenderer.OnDraw(); } }
private void frmMain_Load(object sender, EventArgs e) { using (ModeDialog mld = new ModeDialog()) { if (mld.ShowDialog(this) == DialogResult.OK) { this.currentGame = new Class.Game(this, mld.SelectedMode); } } currentRenderer.OnInit(this.currentGame, this, this.info); this.currentGame.ReDraw += CurrentGame_ReDraw; this.currentGame.Refresh += CurrentGame_Refresh; this.mStrip.BackColor = Color.LightSkyBlue; this.mStrip.ForeColor = Color.Black; }
private void neuesSpielToolStripMenuItem_Click(object sender, EventArgs e) { if (MessageBox.Show(this, "Sind Sie sich sicher, dass Sie das aktuelle Spiel abbrechen und ein neues Spiel starten möchten?", "Neues Spiel?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes) { Spider.Class.Game.Mode currentMode = Class.Game.Mode.OneSuit; using (ModeDialog mld = new ModeDialog()) { if (mld.ShowDialog(this) == DialogResult.OK) { currentMode = mld.SelectedMode; } } this.currentGame.MStructures.Clear(); this.currentGame.OtherCards.Clear(); this.Controls.Remove(this.currentRenderer); this.currentGame = new Class.Game(this, currentMode); this.currentGame.Refresh += CurrentGame_Refresh; this.currentGame.ReDraw += CurrentGame_ReDraw; this.currentRenderer.OnDraw(); if (this.info.HW_ACC) this.currentRenderer = new Spider.Class.Render.SlimDXRenderer(); else this.currentRenderer = new Spider.Class.Render.GDIRenderer(); this.currentRenderer.MouseDown += CurrentRenderer_MouseDown; currentRenderer.OnInit(this.currentGame, this, this.info); currentRenderer.OnDraw(); } }