Package megamek.common

Examples of megamek.common.Player


                                        "In Double Blind play, you cannot choose 'Any' as starting position.");
                        return;
                    }
                    for (Enumeration<Player> e = client.game.getPlayers(); e
                            .hasMoreElements();) {
                        Player player = e.nextElement();
                        if (player.getStartingPos() == 0) {
                            continue;
                        }
                        // CTR and EDG don't overlap
                        if (((player.getStartingPos() == 9) && (i == 10))
                            || ((player.getStartingPos() == 10) && (i == 9))) {
                            continue;
                        }
                        // check for overlapping starting directions
                        if (((player.getStartingPos() == i)
                                || (player.getStartingPos() + 1 == i) || (player
                                .getStartingPos() - 1 == i))
                                && (player.getId() != client.getLocalPlayer()
                                        .getId())) {
                            clientgui
                                    .doAlertDialog(
                                            "Must choose exclusive deployment zone",
                                            "When using double blind, each player needs to have an exclusive deployment zone.");
View Full Code Here


     * object.
     */
    public static void refreshPlayerList(JList playerList, Client client) {
        ((DefaultListModel) playerList.getModel()).removeAllElements();
        for (Enumeration<Player> e = client.getPlayers(); e.hasMoreElements();) {
            final Player player = e.nextElement();
            StringBuffer playerDisplay = new StringBuffer(player.getName());
            if (player.isGhost()) {
                playerDisplay.append(" ["); //$NON-NLS-1$
                playerDisplay.append(Messages
                        .getString("PlayerListDialog.player_ghost")); //$NON-NLS-1$
                playerDisplay.append(']'); //$NON-NLS-1$
            } else if (player.isObserver()) {
                playerDisplay.append(" ["); //$NON-NLS-1$
                playerDisplay.append(Messages
                        .getString("PlayerListDialog.player_observer")); //$NON-NLS-1$
                playerDisplay.append(']'); //$NON-NLS-1$
            } else if (player.isDone()) {
                playerDisplay.append(" ("); //$NON-NLS-1$
                playerDisplay.append(Messages
                        .getString("PlayerListDialog.player_done")); //$NON-NLS-1$
                playerDisplay.append(')'); //$NON-NLS-1$
            }
View Full Code Here

     * object.
     */
    public static void refreshPlayerList(List playerList, Client client) {
        playerList.removeAll();
        for (Enumeration<Player> e = client.getPlayers(); e.hasMoreElements();) {
            final Player player = e.nextElement();
            StringBuffer playerDisplay = new StringBuffer(player.getName());
            if (player.isGhost()) {
                playerDisplay.append(" ["); //$NON-NLS-1$
                playerDisplay.append(Messages
                        .getString("PlayerListDialog.player_ghost")); //$NON-NLS-1$
                playerDisplay.append("]"); //$NON-NLS-1$
            } else if (player.isObserver()) {
                playerDisplay.append(" ["); //$NON-NLS-1$
                playerDisplay.append(Messages
                        .getString("PlayerListDialog.player_observer")); //$NON-NLS-1$
                playerDisplay.append("]"); //$NON-NLS-1$
            } else if (player.isDone()) {
                playerDisplay.append(" ("); //$NON-NLS-1$
                playerDisplay.append(Messages
                        .getString("PlayerListDialog.player_done")); //$NON-NLS-1$
                playerDisplay.append(")"); //$NON-NLS-1$
            }
View Full Code Here

        gp.setMechInSecond(ld.getMechInSecond());
    }

    // Loads a preview image of the unit into the BufferedPanel.
    public void loadPreviewImage(JLabel bp, Entity entity) {
        Player player = client.game.getPlayer(entity.getOwnerId());
        loadPreviewImage(bp, entity, player);
    }
View Full Code Here

        m_labels = new JLabel[pa.length];
        m_typeChoices = new JComboBox[pa.length];
        m_camoButtons = new JButton[pa.length];
        playerTypes = new int[pa.length];
        for (int x = 0; x < pa.length; x++) {
            final Player curPlayer = m_players[x];
            curPlayer.setColorIndex(x);
            m_labels[x] = new JLabel(pa[x].getName(), SwingConstants.LEFT);
            m_typeChoices[x] = new JComboBox();
            m_typeChoices[x].addItem(Messages
                    .getString("MegaMek.ScenarioDialog.me")); //$NON-NLS-1$
            m_typeChoices[x].addItem(Messages
View Full Code Here

        m_camoButtons = new ImageButton[pa.length];

        playerTypes = new int[pa.length];

        for (int x = 0; x < pa.length; x++) {
            final Player curPlayer = m_players[x];
            curPlayer.setColorIndex(x);

            m_labels[x] = new Label(pa[x].getName(), Label.LEFT);

            m_typeChoices[x] = new Choice();
            m_typeChoices[x].add(Messages
View Full Code Here

    private Entity getNextEntity(boolean forward) {
        IGame game = client.game;
        boolean bd = game.getOptions().booleanOption("blind_drop"); //$NON-NLS-1$
        boolean rbd = game.getOptions().booleanOption("real_blind_drop"); //$NON-NLS-1$
        Player p = client.getLocalPlayer();

        Entity nextOne = null;
        if (forward) {
            nextOne = game.getNextEntityFromList(entity);
        } else {
View Full Code Here

    private Entity getNextEntity(boolean forward) {
        IGame game = client.game;
        boolean bd = game.getOptions().booleanOption("blind_drop"); //$NON-NLS-1$
        boolean rbd = game.getOptions().booleanOption("real_blind_drop"); //$NON-NLS-1$
        Player p = client.getLocalPlayer();

        Entity nextOne;
        if (forward) {
            nextOne = game.getNextEntityFromList(entity);
        } else {
View Full Code Here

        String playerName = args[1];
        for(int i = 2; i < args.length; i++) {
            playerName = playerName + " " + args[i];
        }
       
        Player target = null;
        for (Enumeration<Player> i = server.getGame().getPlayers(); i
                .hasMoreElements();) {
            Player player = i.nextElement();
            if (player.getName().equals(playerName)) {
                target = player;
            }
        }

        if (target == null) {
View Full Code Here

    @Override
    public String run(String[] args) {
        if (args.length < 2) {
            return "You must specify a player name.";
        }
        Player target = null;
        for (Enumeration<Player> i = client.game.getPlayers(); i
                .hasMoreElements();) {
            Player player = i.nextElement();
            if (player.getName().equals(args[1])) {
                target = player;
            }
        }

        if (target == null) {
View Full Code Here

TOP

Related Classes of megamek.common.Player

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.