Package agh.sr.rmi.client

Examples of agh.sr.rmi.client.PlayerToken


    public static List<Bot> createBots(String gameName, int botsCount) {

        List<Bot> result = new ArrayList<>();
        for (int i = 0; i < botsCount; i++) {
            PlayerToken playerToken = new PanPlayerToken(gameName + "_bot_" + i, BOTS_ID);
            BotGameListener botGameListener = new BotGameListener(playerToken);
            Bot bot = new PanBot(playerToken, botGameListener);
            result.add(bot);
        }
        return result;
View Full Code Here


            gameListener.newTurn(getNextTurnPlayerToken());
        }
    }

    private PlayerToken getNextTurnPlayerToken() {
        PlayerToken playerToken;
        if (turnIterator == null || !turnIterator.hasNext()) {
            turnIterator = playerTokens.iterator();
        }
        return turnIterator.next();
    }
View Full Code Here

        //TODO uncomment
//        if (players.containsKey(userName)) {
//            throw new GameException("Player name already in use!");
//        }
        PlayerToken playerToken = new PanPlayerToken(userName, PLAYER_ID_COUNTER);

        players.put(userName, playerToken);
        return playerToken;
    }
View Full Code Here

TOP

Related Classes of agh.sr.rmi.client.PlayerToken

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.