private ZertzBoard buildSampleBoard2() { HexLocation[] hls; ZertzBoard board = ZertzBoard.OffsetBoard(out hls); ZertzPiece dead = ZertzPiece.Dead; ZertzPiece blac = ZertzPiece.Vacant; blac.PutBall(ZertzBallType.Black); ZertzPiece gray = ZertzPiece.Vacant; gray.PutBall(ZertzBallType.Gray); ZertzPiece whit = ZertzPiece.Vacant; whit.PutBall(ZertzBallType.White); board[0x00, 0x03] = dead; board[0x00, 0x06] = dead; board[0x01, 0x06] = dead; board[0x02, 0x06] = dead; board[0x03, 0x06] = dead; board[0x05, 0x02] = dead; board[0x06, 0x02] = dead; board[0x06, 0x01] = dead; board[0x03, 0x05] = dead; board[0x04, 0x05] = dead; board[0x04, 0x04] = dead; board[0x05, 0x04] = dead; board[0x05, 0x03] = dead; board[0x06, 0x03] = dead; board[0x01, 0x03] = whit; board[0x02, 0x04] = whit; board[0x02, 0x03] = gray; board[0x05, 0x00] = gray; board[0x03, 0x01] = blac; return(board); }
public ZertzGame(out HexLocation[] hls) { //this.players = new IPlayer[] {playerA,playerB}; this.board = ZertzBoard.OffsetBoard(out hls); this.playersPools = new ZertzBallContainer[] { ZertzBallContainer.Empty(), ZertzBallContainer.Empty() }; this.turn = 0x00; this.zmc = new ZertzMoveCreator(this); }
public ZertzGame(out HexLocation[] hls) { //this.players = new IPlayer[] {playerA,playerB}; this.board = ZertzBoard.OffsetBoard(out hls); this.playersPools = new ZertzBallContainer[] {ZertzBallContainer.Empty(),ZertzBallContainer.Empty()}; this.turn = 0x00; this.zmc = new ZertzMoveCreator(this); }
private void innerTestIsVacant(ZertzBoard board, HexLocation[] vacant) { HashSet <HexLocation> hls = new HashSet <HexLocation>(); foreach (HexLocation l in vacant) { hls.Add(l); } HexLocation hl; for (sbyte i = 0x00; i < 0x07; i++) { for (sbyte j = 0x00; j < 0x07; j++) { hl = new HexLocation(i, j); Assert.AreEqual(hls.Contains(hl), board.IsVacant(hl)); } } }
private ZertzBoard buildSampleBoard9() { HexLocation[] hls; ZertzBoard board = ZertzBoard.OffsetBoard(out hls); ZertzPiece blac = ZertzPiece.Vacant; blac.PutBall(ZertzBallType.Black); for (int i = 0x00; i < 0x07; i++) { for (int j = 0x00; j < 0x07; j++) { if (board[i, j].IsAlive) { board[i, j] = blac; } } } return(board); }
public ZertzMoveCreator(ZertzGame game) { this.zertzGame = game; this.zertzBoard = this.zertzGame.Board; this.state = new StartZertzMoveState(this); }
private ZertzBoard buildSampleBoard0() { HexLocation[] hls; return(ZertzBoard.OffsetBoard(out hls)); }
private void innerTestIsVacant(ZertzBoard board, HexLocation[] vacant) { HashSet<HexLocation> hls = new HashSet<HexLocation>(); foreach(HexLocation l in vacant) { hls.Add(l); } HexLocation hl; for(sbyte i = 0x00; i < 0x07; i++) { for(sbyte j = 0x00; j < 0x07; j++) { hl = new HexLocation(i,j); Assert.AreEqual(hls.Contains(hl),board.IsVacant(hl)); } } }