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); } }
public void button2_Click(object sender, EventArgs e) { for (int i = 0; i < 9; i++) { for (int j = 0; j < 9; j++) { if (Hex_board.GetHexBoard()[i, j].Player == -2 && Hex_board.GetHexBoard()[i, j].Player_Count > 1) { Location loc = new Location(i, j); Stack <Location> path = new AlphaBeta().GetBestPath(this.Hex_board, loc); DoAIMove(path, this.Hex_board); } } } }
} = 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); }
// 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); }
// 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); }
// 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); }
// 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); }