Package org.scotlandyard.engine

Examples of org.scotlandyard.engine.Player


    }
    else if(playerRole==PlayerRole.Detective  && game.getDetectives().size()>=GameEngine.MIXIMUM_NUMBER_OF_DETECTIVES){
        throw new GameException("Sorry, this game is full. try to create another game and play with someone else");
    }

    final Player player;

    if(playerRole==PlayerRole.MrX){

      player = new MrX(user);
      game.setMrX(player);

    }else{ // if(playerRole==PlayerRole.Detective){

      player = new Detective(user);
      game.addDetective((Detective)player);

    }

    game.setPlayerPosition(player.getEmail(),  game.getEmptyPositionLabel());
    return ( JsonFactory.toJson( user.getName() ) );


  }
View Full Code Here


    if(game.isPlayable()==false){
      throw new GameException("the game is still not playable.");
    }

    String position = game.getPlayerPosition(playerEmail);
    Player player=game.getPlayer(playerEmail);

    Token token = player.getTokens(game.getIdentifier())
      .get(TransportationMethod.valueOf(transportationMethod));

    token.consumeTicket();

    player.useTokenToMove(game.getIdentifier(), token, positionReg);


    return JsonFactory.toJson(position);
  }
View Full Code Here

TOP

Related Classes of org.scotlandyard.engine.Player

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.