Package mage.utils

Examples of mage.utils.ActionWithBooleanResult


        return false;
    }

    @Override
    public boolean setUserData(final String userName, final String sessionId, final UserDataView userDataView) throws MageException {
        return executeWithResult("setUserData", sessionId, new ActionWithBooleanResult() {
            @Override
            public Boolean execute() throws MageException {
                return SessionManager.getInstance().setUserData(userName, sessionId, userDataView);
            }
        });
View Full Code Here


        });
    }

    @Override
    public boolean joinTable(final String sessionId, final UUID roomId, final UUID tableId, final String name, final String playerType, final int skill, final DeckCardLists deckList, final String password) throws MageException, GameException {
        return executeWithResult("joinTable", sessionId, new ActionWithBooleanResult() {
            @Override
            public Boolean execute() throws MageException {
                UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId();
                logger.debug(name + " joins tableId: " + tableId);
                if (userId == null) {
View Full Code Here

        });
    }

    @Override
    public boolean joinTournamentTable(final String sessionId, final UUID roomId, final UUID tableId, final String name, final String playerType, final int skill, final DeckCardLists deckList, final String password) throws MageException, GameException {
        return executeWithResult("joinTournamentTable", sessionId, new ActionWithBooleanResult() {
            @Override
            public Boolean execute() throws MageException {
                UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId();
                if (logger.isDebugEnabled()) {
                    User user = UserManager.getInstance().getUser(userId);
View Full Code Here

        });
    }

    @Override
    public boolean submitDeck(final String sessionId, final UUID tableId, final DeckCardLists deckList) throws MageException, GameException {
        return executeWithResult("submitDeck", sessionId, new ActionWithBooleanResult() {
            @Override
            public Boolean execute() throws MageException {
                UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId();
                boolean ret = TableManager.getInstance().submitDeck(userId, tableId, deckList);
                logger.debug("Session " + sessionId + " submitted deck");
View Full Code Here

        return null;
    }

    @Override
    public boolean isTableOwner(final String sessionId, UUID roomId, final UUID tableId) throws MageException {
        return executeWithResult("isTableOwner", sessionId, new ActionWithBooleanResult() {
            @Override
            public Boolean execute() {
                UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId();
                return TableManager.getInstance().isTableOwner(tableId, userId);
            }
View Full Code Here

        });
    }
           
    @Override
    public boolean watchTable(final String sessionId, final UUID roomId, final UUID tableId) throws MageException {
        return executeWithResult("setUserData", sessionId, new ActionWithBooleanResult() {
            @Override
            public Boolean execute() throws MageException {
                UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId();
                return GamesRoomManager.getInstance().getRoom(roomId).watchTable(userId, tableId);
            }
View Full Code Here

        });
    }

    @Override
    public boolean watchTournamentTable(final String sessionId, final UUID tableId) throws MageException {
        return executeWithResult("setUserData", sessionId, new ActionWithBooleanResult() {
            @Override
            public Boolean execute() throws MageException {
                UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId();
                return TableManager.getInstance().watchTable(userId, tableId);
            }
View Full Code Here

        });
    }

    @Override
    public boolean cheat(final UUID gameId, final String sessionId, final UUID playerId, final String cardName) throws MageException {
        return executeWithResult("cheatOne", sessionId, new ActionWithBooleanResult() {
            @Override
            public Boolean execute() {
                if (testMode) {
                    UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId();
                    return GameManager.getInstance().cheat(gameId, userId, playerId, cardName);
View Full Code Here

TOP

Related Classes of mage.utils.ActionWithBooleanResult

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.