예제 #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;
 }
예제 #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;
 }
예제 #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;
 }
예제 #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));
 }
예제 #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;
 }