Package games.pickupbot

Examples of games.pickupbot.Game


        new MainDatabaseManager();

        this.extensionObject.clearGames();

        for (String gameType : this.games) {
            Game game = Game.tryParse(gameType);

            this.extensionObject.addGame(game);
        }

        extensionObject.setExtensionMessenger(this.messenger);
View Full Code Here


        this.object.clearGames();

        this.object.setTopicAutoUpdate(false);

        for (String gameType : this.games) {
            Game game = Game.tryParse(gameType);

            this.object.addGame(game);
        }

        object.setExtensionMessenger(this.messenger);
View Full Code Here

        ExtensionObject.DatabaseManager.addGameProfile(testPlayer1.getHost(), testGameAccount1);
        ExtensionObject.DatabaseManager.addGameProfile(testPlayer2.getHost(), testGameAccount2);
    }

    public void testGameParser() {
        Game game = Game.tryParse(this.games[0]);

        assertNotNull(game);

        assertEquals(game.getGameType(), "ctf");
        assertEquals(game.getMaxPlayers(), 8);
        assertNotNull(game.getPlayerList());
        assertEquals(game.getPlayerList().size(), 0);
    }
View Full Code Here

        assertNotNull(game.getPlayerList());
        assertEquals(game.getPlayerList().size(), 0);
    }

    public void testAddPlayerTwoTimes() {
        Game game = Game.tryParse(this.games[2]);

        game.addPlayer(this.testPlayer1);

        try {
            game.addPlayer(this.testPlayer1);
        } catch (GameError e) {
            assertTrue(true);
        }

        assertEquals(game.getPlayerList().size(), 1);
    }
View Full Code Here

        assertEquals(game.getPlayerList().size(), 1);
    }

    public void testGatherPickupGame() {
        Game game = Game.tryParse(this.games[2]);

        game.addListener(new GameListener() {
            @Override
            public void pickupFormed(Game game) {
                assertTrue(game.getPlayerNicknames()[0].startsWith("testPlayerNick1"));
                assertTrue(game.getPlayerNicknames()[1].startsWith("testPlayerNick2"));
            }

            @Override
            public void playerAutomaticallyRemoved(Player player, Game game) {

            }
        });

        game.addPlayer(this.testPlayer1);
        game.addPlayer(this.testPlayer2);

        assertEquals(game.getPlayerList().size(), 0);
    }
View Full Code Here

        assertEquals(game.getPlayerList().size(), 0);
    }

    public void testRemovePlayer() {
        Game game = Game.tryParse(this.games[2]);

        game.addPlayer(this.testPlayer1);

        game.removePlayer(this.testPlayer1);

        assertEquals(game.getPlayerList().size(), 0);
    }
View Full Code Here

        assertEquals(game.getPlayerList().size(), 0);
    }

    public void testGetPlayerNickNames() {
        Game game = Game.tryParse(this.games[0]);

        game.addPlayer(this.testPlayer1);
        game.addPlayer(this.testPlayer2);

        String nickNames = game.getPlayerNicknamesAsString(", ", false, false);

        assertEquals(nickNames,
                    String.format("%s, %s",
                            this.testPlayer1.getNick(),
                            this.testPlayer2.getNick()));
View Full Code Here

                            this.testPlayer1.getNick(),
                            this.testPlayer2.getNick()));
    }

    public void testPlayerSubstitution() {
        Game game = Game.tryParse(this.games[0]);

        game.addPlayer(this.testPlayer1);

        game.substitutePlayers(this.testPlayer1, this.testPlayer2);

        assertTrue(game.hasPlayers());

        assertEquals(game.getPlayerList().get(0), this.testPlayer2);
    }
View Full Code Here

        assertEquals(game.getPlayerList().get(0), this.testPlayer2);
    }

    public void testLastGame() {
        Game game = Game.tryParse(this.games[2]);

        game.addPlayer(this.testPlayer1);
        game.addPlayer(this.testPlayer2);

        System.out.println(game.lastGame());

        assertTrue(true);
    }
View Full Code Here

TOP

Related Classes of games.pickupbot.Game

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.