} = 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); }
public Stack <Location> GetBestPath( HexBoard board, Location startLocation) { AlphaBetaBoard Clone = new AlphaBetaBoard(board); var bestPath = GetBestPath(Clone, startLocation, 0); return(bestPath.Path); }
// 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); }
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); } } }
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; }
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 HexBattles() { Hex_board = new HexBoard(); InitializeComponent(); }
public HexBattles() { Hex_board = new HexBoard(); PicPlot = new ImagePlot[9, 9]; InitializeComponent(); }
// 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); }
} // 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); }
// 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); }