Search in sources :

Example 11 with MatchPlayer

use of mage.game.match.MatchPlayer in project mage by magefree.

the class GameController method viewSideboard.

private void viewSideboard(UUID playerId, UUID userId, UUID targetPlayerId) {
    Player needPlayer = game.getPlayer(playerId);
    if (needPlayer != null && needPlayer.isHuman()) {
        for (MatchPlayer p : managerFactory.tableManager().getTable(tableId).getMatch().getPlayers()) {
            if (p.getPlayer().getId().equals(playerId)) {
                Optional<User> u = managerFactory.userManager().getUser(userId);
                u.ifPresent(user -> user.ccViewSideboard(tableId, game.getId(), targetPlayerId));
            }
        }
    }
}
Also used : MatchPlayer(mage.game.match.MatchPlayer) Player(mage.players.Player) User(mage.server.User) MatchPlayer(mage.game.match.MatchPlayer)

Aggregations

MatchPlayer (mage.game.match.MatchPlayer)11 Match (mage.game.match.Match)2 TournamentPlayer (mage.game.tournament.TournamentPlayer)2 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 MageException (mage.MageException)1 Deck (mage.cards.decks.Deck)1 DeckValidatorError (mage.cards.decks.DeckValidatorError)1 Game (mage.game.Game)1 MatchQuitStatus (mage.game.result.ResultProtos.MatchQuitStatus)1 Player (mage.players.Player)1 User (mage.server.User)1