コード例 #1
0
ファイル: Box.cs プロジェクト: bubbafat/Dots-and-Boxes-Game
 public Box(Line top, Line right, Line bottom, Line left, Player p, ICornerMapper cm)
 {
     m_Top = top;
     m_Bottom = bottom;
     m_Left = left;
     m_Right = right;
     m_Player = p;
     m_Mapper = cm;
 }
コード例 #2
0
        private void btnStart_Click(object sender, EventArgs e)
        {
            GameBoard gb = new GameBoard(
                    int.Parse(cbBoardHeight.Text, CultureInfo.CurrentCulture),
                    int.Parse(cbBoardWidth.Text, CultureInfo.CurrentCulture)
                );

            GamePanel f = new GamePanel();

            Player[] players = new Player[2];

            switch (this.cbPlayer1Type.SelectedIndex)
            {
                case 0: // human
                    players[0] = new InkInputPlayer(txtPlayer1Name.Text, "P1", Color.Tomato, f.inkPanel, gb);
                    break;
                case 1: // Computer (Good)
                    players[0] = new AI_PickHighPoint(txtPlayer1Name.Text, "P1", Color.Tomato);
                    break;
                case 2: // Computer (Random)
                    players[0] = new AI_PickRandomPoint(txtPlayer1Name.Text, "P1", Color.Tomato);
                    break;
                case 3: // Computer (Intentionally Bad)
                    players[0] = new AI_PickWorstPoint(txtPlayer1Name.Text, "P1", Color.Tomato);
                    break;
            }

            switch (this.cbPlayer2Type.SelectedIndex)
            {
                case 0: // human
                    players[1] = new InkInputPlayer(txtPlayer2Name.Text, "P2", Color.Navy, f.inkPanel, gb);
                    break;
                case 1: // Computer (Good)
                    players[1] = new AI_PickHighPoint(txtPlayer2Name.Text, "P2", Color.Navy);
                    break;
                case 2: // Computer (Random)
                    players[1] = new AI_PickRandomPoint(txtPlayer2Name.Text, "P2", Color.Navy);
                    break;
                case 3: // Computer (Intentionally Bad)
                    players[1] = new AI_PickWorstPoint(txtPlayer2Name.Text, "P2", Color.Navy);
                    break;
            }

            Game g = new Game(players, gb);
            g.FreeMoveOnScore = cbFreeMove.Checked;
            f.Initialize(g);
            f.ShowDialog();
        }
コード例 #3
0
ファイル: Move.cs プロジェクト: bubbafat/Dots-and-Boxes-Game
 public void SetPlayer(Player p)
 {
     m_Player = p;
 }
コード例 #4
0
ファイル: Move.cs プロジェクト: bubbafat/Dots-and-Boxes-Game
 public Move(Line line, Player player)
 {
     m_Line = line;
     m_Player = player;
 }
コード例 #5
0
ファイル: Box.cs プロジェクト: bubbafat/Dots-and-Boxes-Game
 public Box(Corner ul, Corner ur, Corner lr, Corner ll, Player p, ICornerMapper cm)
     : this(new Line(ul, ur), new Line(ur, lr), new Line(ll, lr), new Line(ll, ul), p, cm)
 {
 }