Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 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);
 }
Esempio n. 3
0
 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);
 }
Esempio n. 4
0
        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));
                }
            }
        }
Esempio n. 5
0
        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);
        }
Esempio n. 6
0
 public ZertzMoveCreator(ZertzGame game)
 {
     this.zertzGame = game;
     this.zertzBoard = this.zertzGame.Board;
     this.state = new StartZertzMoveState(this);
 }
Esempio n. 7
0
 private ZertzBoard buildSampleBoard0()
 {
     HexLocation[] hls;
     return(ZertzBoard.OffsetBoard(out hls));
 }
Esempio n. 8
0
 public ZertzMoveCreator(ZertzGame game)
 {
     this.zertzGame  = game;
     this.zertzBoard = this.zertzGame.Board;
     this.state      = new StartZertzMoveState(this);
 }
Esempio n. 9
0
 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));
         }
     }
 }