Ejemplo n.º 1
0
 public void PlacePiece(int space, Player.Piece piece)
 {
     if (IsSpaceFree(space))
     {
         _playingGrid[space] = piece;
     }
 }
Ejemplo n.º 2
0
 private static bool HasPieceWon(Player.Piece[] boardState, Player.Piece piecetoCheck)
 {
     if (boardState[0] == piecetoCheck && boardState[1] == piecetoCheck && boardState[2] == piecetoCheck)
     {
         return(true);
     }
     if (boardState[3] == piecetoCheck && boardState[4] == piecetoCheck && boardState[5] == piecetoCheck)
     {
         return(true);
     }
     if (boardState[6] == piecetoCheck && boardState[7] == piecetoCheck && boardState[8] == piecetoCheck)
     {
         return(true);
     }
     if (boardState[0] == piecetoCheck && boardState[3] == piecetoCheck && boardState[6] == piecetoCheck)
     {
         return(true);
     }
     if (boardState[0] == piecetoCheck && boardState[3] == piecetoCheck && boardState[6] == piecetoCheck)
     {
         return(true);
     }
     if (boardState[1] == piecetoCheck && boardState[4] == piecetoCheck && boardState[7] == piecetoCheck)
     {
         return(true);
     }
     if (boardState[2] == piecetoCheck && boardState[5] == piecetoCheck && boardState[8] == piecetoCheck)
     {
         return(true);
     }
     if (boardState[2] == piecetoCheck && boardState[4] == piecetoCheck && boardState[6] == piecetoCheck)
     {
         return(true);
     }
     return(false);
 }
Ejemplo n.º 3
0
 public Square(Player.Piece ruta)
 {
     VärdeRuta = ruta;
 }
Ejemplo n.º 4
0
 public void PlaceChange(Player.Piece field, int index)
 {
     spel[index].ChangeStatus(field);
 }
Ejemplo n.º 5
0
 public void MakeMove(int space, Player.Piece piece, Board board)
 {
     board.PlacePiece(space, piece);
     _moveCounter++;
 }
Ejemplo n.º 6
0
 public Player(Player.Piece piece)
 {
     PlayerPiece = piece;
 }
Ejemplo n.º 7
0
 public Player(Player.Piece pla)
 {
     PlayerPiece = pla;
 }
Ejemplo n.º 8
0
 public Square(Player.Piece empty)
 {
     CurrentPiece = empty;
 }
Ejemplo n.º 9
0
 public void ChangeStatus(Player.Piece square)
 {
     PieceStatus = square;
 }
Ejemplo n.º 10
0
 public Square(Player.Piece play)
 {
     PieceStatus = play;
 }