Examples of PlayerAction


Examples of com.barrybecker4.game.common.player.PlayerAction

     * @param responses at the least this will be the players action that we received, but it may contain robot
     *       actions for the robots on the server that play immediately after the player.
     */
    private void doPlayerAction(GameCommand cmd, List<GameCommand> responses) {

        PlayerAction action = (PlayerAction) cmd.getArgument();
        GameContext.log(0, "ServerCmdProc: doPlayerAction (" + action + "). Surrogates to handle");
        controller_.handlePlayerAction(action);

        responses.add(cmd);

View Full Code Here

Examples of com.barrybecker4.game.common.player.PlayerAction

     */
    @Override
    public synchronized boolean handleServerUpdate(GameCommand cmd) {

        if (cmd.getName() == GameCommand.Name.DO_ACTION) {
            PlayerAction action = (PlayerAction) cmd.getArgument();
            if (action.getPlayerName().equals(player.getName())) {
                GameContext.log(0, "Setting surrogate(" + player.getName()
                        + ") action="+action + " on "+this+",  Thread=" + Thread.currentThread().getName());
                synchronized (player) {
                    player.setAction(action);
                    player.notifyAll()// unblock the wait below
View Full Code Here

Examples of com.barrybecker4.game.common.player.PlayerAction

        try {
            long t1 = System.currentTimeMillis();
            System.out.println(player.getName() + " now waiting for surrogate action on "
                    + this + ",  Thread=" + Thread.currentThread().getName());

            PlayerAction action = null;
            synchronized (player) {

                while (action == null) {
                    player.wait(TIMEOUT_DURATION);
                    if ((System.currentTimeMillis() - t1) > (TIMEOUT_DURATION - 10)) {
View Full Code Here

Examples of com.barrybecker4.game.common.player.PlayerAction

     */
    @Override
    public boolean handleServerUpdate(GameCommand cmd) {

         if (cmd.getName() == GameCommand.Name.DO_ACTION) {
            PlayerAction action = (PlayerAction) cmd.getArgument();
            if (action.getPlayerName().equals(player.getName())) {
                return true;
            }
        }
        return true;
    }
View Full Code Here

Examples of com.barrybecker4.game.common.player.PlayerAction

    public boolean doComputerMove(Player player) {
        assert(!player.isHuman());
        PokerRobotPlayer robot = (PokerRobotPlayer)player.getActualPlayer();
        PokerController pc = (PokerController) controller_;

        PlayerAction action = robot.getAction(pc);
        String msg = applyAction(action, robot);
        pc.addRecentRobotAction(action);

        JOptionPane.showMessageDialog(parent_, msg, robot.getName(), JOptionPane.INFORMATION_MESSAGE);
        refresh();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.