Ejemplo n.º 1
0
        private void ContinueBtn_Click(object sender, EventArgs e)
        {
            if (ContinueBtn.Text == "游戏结束")
            {
                NewGame form1 = new NewGame();
                form1.TopLevel = false;
                this.Parent.Controls.Add(form1);
                this.Parent.Controls.Remove(this);
                form1.Show();
                this.Close();
                this.Dispose();
                return;
            }

            if (curGame.CurTurn <= curGame.GameChapter.SumTurn)
            {
                MakePlan makePlan = new MakePlan(curGame);
                makePlan.TopLevel = false;
                this.Parent.Controls.Add(makePlan);
                this.Parent.Controls.Remove(this);
                makePlan.Show();
                this.Close();
                this.Dispose();
            }
            else
            {
                GameResult result = new GameResult(curGame);
                ContinueBtn.Text    = "游戏结束";
                ContinueBtn.Enabled = false;
                PrintResult(result);
                ContinueBtn.Enabled = true;
            }
        }
Ejemplo n.º 2
0
        private void Begin_Click(object sender, EventArgs e)
        {
            string text = PlayerName.Text;

            if (text == null || text == "")
            {
                AlertForm alertForm = new AlertForm("玩家名不能为空!");
                alertForm.ShowDialog();
                return;
            }
            Game newGame = new Game();

            newGame.CurTurn     = 0;
            newGame.GameChapter = GameSystem.ChapterList[ChapterIdx];
            newGame.PlayerName  = text;
            newGame.Buff        = 0;
            newGame.Pressure    = 50;
            newGame.IfNight     = 0;
            MakePlan makePlan = new MakePlan(newGame);

            makePlan.TopLevel = false;
            this.Parent.Controls.Add(makePlan);
            this.Parent.Controls.Remove(this);
            makePlan.Show();
            this.Close();
        }
Ejemplo n.º 3
0
        private void LoadGame_Click(object sender, EventArgs e)
        {
            GameSaveForm gameSave = new GameSaveForm();

            gameSave.StartPosition = FormStartPosition.CenterParent;
            gameSave.ShowDialog();
            if (gameSave.SavedGame == null)
            {
                return;
            }
            MakePlan makePlan = new MakePlan(gameSave.SavedGame);

            makePlan.TopLevel = false;
            this.Parent.Controls.Add(makePlan);
            this.Parent.Controls.Remove(this);
            this.Close();
            gameSave.Dispose();
            makePlan.Show();
        }