Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class HumanPlayer extends Player{
- public HumanPlayer(String n, Pieces p, Board b, Player o){
- super(n, p, b, o);
- }
- public boolean makeMove() {
- Scanner sc = new Scanner(System.in);
- System.out.println("Select Piece Position: ");
- System.out.print("X: ");
- int inputX = sc.nextInt();
- System.out.print("Y: ");
- int inputY = sc.nextInt();
- System.out.println("Select to Move to: ");
- System.out.print("X: ");
- int inputX2 = sc.nextInt();
- System.out.print("Y: ");
- int inputY2 = sc.nextInt();
- Board b = new Board();
- Pieces white = new Pieces(b, 1);
- Pieces black = new Pieces(b, 0);
- Move move = new Move(b.getPiece(inputX-1, inputY-1), inputX, inputY, inputX2, inputY2, false);
- if ((b.getPiece(inputX-1, inputY-1)).availableMoves().contains(move)==true){
- return true;
- }
- else
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement