Examples of Player


Examples of mage.players.Player

  }

  @Override
  public boolean pay(Game game, UUID sourceId, UUID controllerId, boolean noMana) {
    if (targets.choose(Outcome.Discard, controllerId, game)) {
      Player player = game.getPlayer(controllerId);
      for (UUID targetId: targets.get(0).getTargets()) {
        Card card = player.getHand().get(targetId, game);
        if (card == null)
          return false;
        paid |= player.discard(card, null, game);
      }
    }
    return paid;
  }
View Full Code Here

Examples of main.Player

  }
 
  @Override
  public void load() {
    hill = new VolcanoHill(100);
    p = new Player(175, 400, 50, 100);
    hill.setPlayerPosition(200);
  }
View Full Code Here

Examples of megamek.common.Player

        case PHASE_SET_ARTYAUTOHITHEXES:
            sendSpecialHexDisplayPackets();
            Enumeration<Player> e = game.getPlayers();
            boolean mines = false;
            while (e.hasMoreElements() && !mines) {
                Player p = e.nextElement();
                if (p.hasMinefields()) {
                    mines = true;
                }
            }
            if (mines) {
                changePhase(IGame.Phase.PHASE_DEPLOY_MINEFIELDS);
            } else {
                changePhase(IGame.Phase.PHASE_INITIATIVE);
            }
            break;
        case PHASE_DEPLOY_MINEFIELDS:
            changePhase(IGame.Phase.PHASE_INITIATIVE);
            break;
        case PHASE_DEPLOYMENT:
            game.clearDeploymentThisRound();
            game.checkForCompleteDeployment();
            Enumeration<Player> pls = game.getPlayers();
            while (pls.hasMoreElements()) {
                Player p = pls.nextElement();
                p.adjustStartingPosForReinforcements();
            }

            if (game.getRoundCount() < 1) {
                changePhase(IGame.Phase.PHASE_INITIATIVE);
            } else {
                changePhase(IGame.Phase.PHASE_TARGETING);
            }
            break;
        case PHASE_INITIATIVE:
            game.addReports(vPhaseReport);
            changePhase(IGame.Phase.PHASE_INITIATIVE_REPORT);
            break;
        case PHASE_INITIATIVE_REPORT:
            // boolean doDeploy = game.shouldDeployThisRound() &&
            // (game.getLastPhase() != IGame.Phase.PHASE_DEPLOYMENT);
            if (game.shouldDeployThisRound()) {
                changePhase(IGame.Phase.PHASE_DEPLOYMENT);
            } else {
                changePhase(IGame.Phase.PHASE_TARGETING);
            }
            break;
        case PHASE_MOVEMENT:
            doAllAssaultDrops();
            addMovementHeat();
            applyBuildingDamage();
            checkForPSRFromDamage();
            addReport(resolvePilotingRolls()); // Skids cause damage in
                                                // movement phase
            checkForFlamingDamage();
            checkForTeleMissileAttacks();
            // check phase report
            if (vPhaseReport.size() > 1) {
                game.addReports(vPhaseReport);
                changePhase(IGame.Phase.PHASE_MOVEMENT_REPORT);
            } else {
                // just the header, so we'll add the <nothing> label
                addReport(new Report(1205, Report.PUBLIC));
                game.addReports(vPhaseReport);
                sendReport();
                changePhase(IGame.Phase.PHASE_OFFBOARD);
            }
            break;
        case PHASE_MOVEMENT_REPORT:
            changePhase(IGame.Phase.PHASE_OFFBOARD);
            break;
        case PHASE_FIRING:
            resolveAllButWeaponAttacks();
            reportGhostTargetRolls();
            reportLargeCraftECCMRolls();
            resolveOnlyWeaponAttacks();
            assignAMS();
            handleAttacks();
            resolveScheduledNukes();
            applyBuildingDamage();
            checkForPSRFromDamage();
            addReport(resolvePilotingRolls());
            // check phase report
            if (vPhaseReport.size() > 1) {
                game.addReports(vPhaseReport);
                changePhase(IGame.Phase.PHASE_FIRING_REPORT);
            } else {
                // just the header, so we'll add the <nothing> label
                addReport(new Report(1205, Report.PUBLIC));
                sendReport();
                game.addReports(vPhaseReport);
                changePhase(IGame.Phase.PHASE_PHYSICAL);
            }
            break;
        case PHASE_FIRING_REPORT:
            changePhase(IGame.Phase.PHASE_PHYSICAL);
            break;
        case PHASE_PHYSICAL:
            resolvePhysicalAttacks();
            applyBuildingDamage();
            checkForPSRFromDamage();
            addReport(resolvePilotingRolls());
            resolveSinkVees();
            // check phase report
            if (vPhaseReport.size() > 1) {
                game.addReports(vPhaseReport);
                changePhase(IGame.Phase.PHASE_PHYSICAL_REPORT);
            } else {
                // just the header, so we'll add the <nothing> label
                addReport(new Report(1205, Report.PUBLIC));
                game.addReports(vPhaseReport);
                sendReport();
                changePhase(IGame.Phase.PHASE_END);
            }
            break;
        case PHASE_PHYSICAL_REPORT:
            changePhase(IGame.Phase.PHASE_END);
            break;
        case PHASE_TARGETING:
            vPhaseReport.addElement(new Report(1035, Report.PUBLIC));
            resolveAllButWeaponAttacks();
            resolveOnlyWeaponAttacks();
            handleAttacks();
            // check reports
            if (vPhaseReport.size() > 1) {
                game.addReports(vPhaseReport);
                changePhase(IGame.Phase.PHASE_TARGETING_REPORT);
            } else {
                // just the header, so we'll add the <nothing> label
                vPhaseReport.addElement(new Report(1205, Report.PUBLIC));
                game.addReports(vPhaseReport);
                sendReport();
                changePhase(IGame.Phase.PHASE_MOVEMENT);
            }

            sendSpecialHexDisplayPackets();

            break;
        case PHASE_OFFBOARD:
            // write Offboard Attack Phase header
            addReport(new Report(1100, Report.PUBLIC));
            resolveAllButWeaponAttacks(); // torso twist or flip arms
            // possible
            resolveOnlyWeaponAttacks(); // should only be TAG at this point
            handleAttacks();
            for (Enumeration<Player> i = game.getPlayers(); i.hasMoreElements();) {
                Player player = i.nextElement();
                int connId = player.getId();
                send(connId, createArtilleryPacket(player));
            }
            applyBuildingDamage();
            checkForPSRFromDamage();
            addReport(resolvePilotingRolls());
View Full Code Here

Examples of meganetpo.Player

  FindListModel.clear();
  ArrayList<Integer> hashWord;
  ArrayList<Integer> hashWordList = new ArrayList<Integer>();
  for (int i = 0; i < listModel.size(); i++) {
      hashWord = new ArrayList<Integer>();
      Player player = (Player) listModel.getElementAt(i);
      String nick = player.getName();
      for (int j = 0; j < nick.length(); j++) {
    String chr = Character.toString(nick.charAt(j));
    hashWord.add(base.getLetterHash(chr));
      }
      int nickHash = hashWord.hashCode();
View Full Code Here

Examples of model.Player

    @Override
    public void doBusiness() throws Exception {
        System.out.println("User '" + user_id + "' is connecting...");

        Player player = null;

        if (version.compareTo(Constants.CLIENT_VERSION) >= 0) {
            if (!user_id.isEmpty() && password.matches("[a-fA-F0-9]{32}")) {
                player = PlayerDAO.getAccount(user_id, password);
            }

            if (player == null) {
                responseLogin.setStatus((short) 1);//Username/password is wrong.
                System.out.println("User '" + user_id + "' has failed to log in.");
            } else {
                if (client.getPlayer() == null || player.getID() != client.getPlayer().getID()) {
                    GameClient thread = client.getServer().getThreadByPlayerID(player.getID());

                    if (thread != null) {
                        responseLogin.setStatus((short) 2);//Account is being used.
                        thread.stopClient();
                    } else {
                        PlayerDAO.updateLogin(player.getID(), client.getIP());
                        GameServer.getInstance().setActivePlayer(player);
                        player.setClient(client);
                        player.setLastSaved(System.currentTimeMillis());
                        player.startSaveTimer();
                        //Put the current user in its thread.
                        //Add the thread to active threads.
                        client.setPlayer(player);
                        client.getServer().addToActiveThreads(client);
                        //Set response information.
                        responseLogin.setStatus((short) 0);//Login succeeds!
                        responseLogin.setPlayer(player);

                        List<Avatar> avatarList = AvatarDAO.getAvatars(client.getPlayer().getID());
                        responseLogin.setAvatarList(avatarList);
                       
                        List<World> worldList = WorldDAO.getPlayerWorlds(client.getPlayer().getID());
                        List<Integer> scoreList = new ArrayList<Integer>();

                        for (World world : worldList) {
                            List<Environment> envList = EnvironmentDAO.getEnvironmentByWorldID(world.getID());

                            if (!envList.isEmpty()) {
                                for (Environment env : envList) {
                                    scoreList.add(env.getEnvironmentScore());
                                }
                            } else {
                                scoreList.add(0);
                            }
                        }

                        responseLogin.setWorldList(worldList, scoreList);

                        //Set the player's current position 0(0 means in the main lobby.)
                        client.getServer().trackPlayerPosition(player.getID(), Constants.LOCATION_MAIN_LOBBY);

                        System.out.println("User '" + player.getUsername() + "' has successfully logged in.");
                    }
                } else {
                    responseLogin.setStatus((short) 4);
                }
            }
View Full Code Here

Examples of models.Player

public class GameTest{
  public static void main(String [ ] args){
    CurrentCardList currentCardList = new CurrentCardList();
    Bank bank = new Bank(currentCardList);
    Player player1 = new Player("Jojo");
    Player player2 = new Player("Juju");
    MenuBar menuBar = new MenuBar();
    HelpPanel helpPanel = new HelpPanel();
    ButtonPanel buttonPanel = new ButtonPanel(helpPanel);
    CurrentPlayerList currentPlayerList = new CurrentPlayerList(bank, currentCardList);
    currentPlayerList.addPlayer(player1);
View Full Code Here

Examples of models.data.Player

  }

  @Test
  public void createAndStartGameSuccess() {
   
    Player player = new Player();
    player.setEmail("player1@columbia.edu");
    player.setId(1);
   
    Mockito.when(UserManager.getCurrentLoggedInUser()).thenReturn(
        player);
   
    Game game = gameManager.createFixedTimeChallengeGame(gameForm);
View Full Code Here

Examples of monopoly.model.personality.Player

    private Player nextPlayer() {
        if (_playersQueue.isEmpty()) {
            return null;
        }

        Player p = _playersQueue.poll();
        _playersQueue.offer(p);

        return p;
    }
View Full Code Here

Examples of mymadrid.entite.Player

   
   
    public static void main(String[] args) throws SQLException, IOException {
    Vector<Player> listPlayers ;
    PlayerDao pdao = new PlayerDao();
    Player cassilas = new Player("Iker", "Casillas Fernandez", new Date(81, 05, 20, "Mostoles, Spain", "Goalkeeper", "182.2 cm", "85.5 kg", "Spanish", "I am a winner whose work is based on humiliy", 1 ,"./images/casillas.jpg");
   
   
    Player ALONSO = new Player("XABI", "Alonso Olano", new Date(81, 11, 25, "Tolosa, Spain", "Midfielder", "182.7 cm", "79 kg", "Spanish", "I am simply a team player", 14 ,"./images/alonso.jpg");
    Player OZIL = new Player("Mesut", "OZIL", new Date(88, 10, 15, "Gelsenkirchen, Germany", "Midfielder", "181 cm", "70 kg", "German", "I will do my best to win titles with Real Madrid", 10 ,"./images/ozil.jpg");
    Player PEPE = new Player("PEPE", "Kléper Laverán", new Date(86, 02, 26, "Maceió, Brazil", "Defender", "187.1 cm", "81 kg", "Portuguese/Brazilian", "I have character and I am devoted to this club and to my team-mates", 3 ,"./images/pepe.jpg");
    Player ronaldo = new Player("CRISTIANO RONALDO", "dos Santos Aveiro", new Date(85, 02, 05, "Madeira, Portugal", "Forward", "186.5 cm", "84.5 kg", "Portuguese", "I am an ambitious player with only one objective: victory fo my team", 7 ,"./images/ronaldo.jpg");
   
    Player Kaka = new Player("KAKA", "Ricardo Izecson Dos Santos", new Date(82, 04, 22, "Brasilia, Brazil", "Midfielder", "185.6 cm", "82 kg", "Brazilian", "I dream about a great play every day of my life", 8 ,"./images/kaka.jpg");
   
    Player Benzima = new Player("BENZEMA", "Karim", new Date(87, 12, 19, "Lyon, France", "Forward", "184.1 cm", "83.5 kg", "French", "I am a striker who loves good football", 9 ,"./images/benzima.jpg");
   
     pdao.InsertPlayer(Kaka);
    pdao.InsertPlayer(Benzima);
   
//    pdao.InsertPlayer(ALONSO);
View Full Code Here

Examples of net.alteiar.player.Player

  public void createPlayer(String name, Boolean isMj, Color color) {
    if (currentPlayer == null) {
      // create current player
      Long connectTimeout30second = 30000L;

      Player current = new Player(name, isMj, color);
      current.setConnected(true);
      addBean(current);
      currentPlayer = getBean(current.getId(), connectTimeout30second);
      if (currentPlayer == null) {
        throw new RuntimeException("impossible de créer un joueur");
      }
      connectPlayer();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.