Ejemplo n.º 1
0
 private Boolean isValidRookDirection(PieceMove.Directions dir)
 {
     return dir == PieceMove.Directions.N || dir == PieceMove.Directions.E || dir == PieceMove.Directions.S || dir == PieceMove.Directions.W;
 }
Ejemplo n.º 2
0
 private Boolean isValidQueenDirection(PieceMove.Directions dir)
 {
     return dir != PieceMove.Directions.NNW && dir != PieceMove.Directions.NNE && dir != PieceMove.Directions.NEE && dir != PieceMove.Directions.NWW && dir != PieceMove.Directions.SEE && dir != PieceMove.Directions.SSE && dir != PieceMove.Directions.SWW && dir != PieceMove.Directions.SSW;
 }
Ejemplo n.º 3
0
 private Boolean isValidKnightDirection(PieceMove.Directions dir)
 {
     return dir == PieceMove.Directions.NEE || dir == PieceMove.Directions.NNE || dir == PieceMove.Directions.NWW || dir == PieceMove.Directions.NNW || dir == PieceMove.Directions.SSW || dir == PieceMove.Directions.SWW || dir == PieceMove.Directions.SEE || dir == PieceMove.Directions.SSE;
 }
Ejemplo n.º 4
0
 private Boolean isValidPawnDirection(PieceMove.Directions dir)
 {
     return (this.PieceColor == Color.Black && (dir == PieceMove.Directions.S || dir == PieceMove.Directions.SE || dir == PieceMove.Directions.SW)) || (this.PieceColor == Color.White && (dir == PieceMove.Directions.N || dir == PieceMove.Directions.NE || dir == PieceMove.Directions.NW));
 }
Ejemplo n.º 5
0
 private Boolean isValidKingDirection(PieceMove.Directions dir)
 {
     return dir == PieceMove.Directions.N || dir == PieceMove.Directions.E || dir == PieceMove.Directions.S || dir == PieceMove.Directions.W || dir == PieceMove.Directions.NW || dir == PieceMove.Directions.NE || dir == PieceMove.Directions.SW || dir == PieceMove.Directions.SE;
 }