Exemplo n.º 1
0
        } = null;                                                       // Used to save the properties of the first click

        // Creates the picture
        public PictureBoxPlayer(int Player_I, int Player_J, HexBoard board)
        {
            this.Row    = Player_I;
            this.Column = Player_J;
            this.BringImage(board.GetHexBoard()[Player_I, Player_J].Player);
            this.Size = new System.Drawing.Size(60, 60);
        }
Exemplo n.º 2
0
        public Stack <Location> GetBestPath(
            HexBoard board,
            Location startLocation)
        {
            AlphaBetaBoard Clone    = new AlphaBetaBoard(board);
            var            bestPath = GetBestPath(Clone, startLocation, 0);

            return(bestPath.Path);
        }
Exemplo n.º 3
0
        // Creates the picture
        public PictureBoxHex(int Hex_I, int Hex_J, HexBoard board)
        {
            this.Row    = Hex_I;
            this.Column = Hex_J;
            int y = 10 + (35 * this.Row), x = (500 - this.Row * 35) + (70 * this.Column);

            x = (x - Hex_I * 35) + (55 * Hex_J) - d[Hex_J];

            this.BringImage(board.GetHexBoard()[Hex_I, Hex_J].Hex);
            this.Location = new System.Drawing.Point(x, y);
            this.Size     = new System.Drawing.Size(70, 70);
        }
Exemplo n.º 4
0
        // Creates the picture
        public PictureBoxHex(int Hex_I, int Hex_J)
        {
            this.Row    = Hex_I;
            this.Column = Hex_J;
            int y = 10 + (35 * this.Row), x = (390 - this.Row * 35) + (70 * this.Column);

            x = x - (x - this.Row * 35) + 55 * this.Column - d[this.Column];

            this.BringImage(HexBoard.GetHexBoard()[Hex_I, Hex_J].Hex);
            this.Location = new System.Drawing.Point(x, y);
            this.Size     = new System.Drawing.Size(70, 70);
        }
Exemplo n.º 5
0
        public AlphaBetaBoard(HexBoard board) : base()
        {
            this.Parent = board;

            for (int i = 0; i < 9; i++)
            {
                for (int j = 0; j < 9; j++)
                {
                    var parentPlot = this.Parent.GetHexBoard()[i, j];
                    this.Hex_Board[i, j] = new Plot(parentPlot.Hex, parentPlot.Player, parentPlot.Player_Count);
                }
            }
        }
Exemplo n.º 6
0
        private void DoAIMove(Stack <Location> moves, HexBoard board)
        {
            while (moves.Count >= 2)
            {
                Location from = moves.Pop();
                Location to   = moves.Peek();
                board.DoMove(from, to);

                this.PicPlot[from.x, from.y].NumPic.AddNumImage(1);
                this.PicPlot[to.x, to.y].PlayerPic.AddPlayerImage(-2);
                this.PicPlot[to.x, to.y].NumPic.AddNumImage(this.Hex_board[to].Player_Count);
            }
            return;
        }
Exemplo n.º 7
0
        private bool IsItWorthIt(Location from, Location to, HexBoard board)
        {
            int Player1 = board.GetHexBoard()[from.x, from.y].Player_Count;
            int player2 = board.GetHexBoard()[to.x, to.y].Player_Count;

            if (Player1 > player2)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 8
0
 public HexBattles()
 {
     Hex_board = new HexBoard();
     InitializeComponent();
 }
Exemplo n.º 9
0
 public HexBattles()
 {
     Hex_board = new HexBoard();
     PicPlot   = new ImagePlot[9, 9];
     InitializeComponent();
 }
Exemplo n.º 10
0
 // Creates the picture
 public PictureBoxPlayer(int Player_I, int Player_J)
 {
     this.BringImage(HexBoard.GetHexBoard()[Player_I, Player_J].Player);
     this.Size = new System.Drawing.Size(70, 70);
 }
Exemplo n.º 11
0
        }                                            // Holds the number of soldiers

        // Builds the imageplot with the images of the hex and the player
        public ImagePlot(int i, int j, HexBoard board)
        {
            this.HexPic    = new PictureBoxHex(i, j, board);
            this.PlayerPic = new PictureBoxPlayer(i, j, board);
            this.NumPic    = new PictureBoxNumber(i, j, board);
        }
Exemplo n.º 12
0
 // creates he picture
 public PictureBoxNumber(int i, int j, HexBoard board)
 {
     this.BringImage(board.GetHexBoard()[i, j].Player_Count);
     this.Size = new System.Drawing.Size(20, 20);
 }