Examples of Team


Examples of com.tommytony.war.Team

    }
  }

  @EventHandler(priority = EventPriority.LOW)
  public void onPlayerChat(final AsyncPlayerChatEvent event) {
    Team team = Team.getTeamByPlayerName(event.getPlayer().getName());
    if (team != null && team.isInTeamChat(event.getPlayer())) {
      event.setCancelled(true);
      team.sendTeamChatMessage(event.getPlayer(), event.getMessage());
    }
  }
View Full Code Here

Examples of common.Team

   * @param args
   */
  public static void main(String[] args) {
    TournamentGroupWithDirectEliminatory event = new TournamentGroupWithDirectEliminatory(null);

    Team homeTeam = new Team("ATTA Ablis premiere");
    Team guestTeam = new Team("ATTA Ablis deuxieme");
    homeTeam.addPlayer('A', new Player("Thibault", "T", new Date(Date.UTC(80,05,23,06,22,00)),
        Short.parseShort("1000"),Short.parseShort("1000"), Short.parseShort("1000"),
        780001, 7812345)
        );
    homeTeam.addPlayer('B', new Player("Franck", "F", new Date(),
        Short.parseShort("1000"),Short.parseShort("1000"), Short.parseShort("1000"),
        780001, 7812345)
        );
    homeTeam.addPlayer('C', new Player("Patrick", "P", new Date(),
        Short.parseShort("1000"),Short.parseShort("1000"), Short.parseShort("1000"),
        780001, 7812345)
        );
    homeTeam.addPlayer('D', new Player("Laurent", "L", new Date(),
        Short.parseShort("1000"),Short.parseShort("1000"), Short.parseShort("1000"),
        780001, 7812345)
        );
    homeTeam.addPlayer('E', new Player("Gregory", "G", new Date(),
        Short.parseShort("1000"),Short.parseShort("1000"), Short.parseShort("1000"),
        780001, 7812345)
        );
    homeTeam.addPlayer('F', new Player("Jean-Christophe", "JC", new Date(),
        Short.parseShort("1000"),Short.parseShort("1000"), Short.parseShort("1000"),
        780001, 7812345)
        );
    homeTeam.addPlayerForBottomDouble('E');
    homeTeam.addPlayerForBottomDouble('F');
    homeTeam.addPlayerForTopDouble('A');
    homeTeam.addPlayerForTopDouble('B');

    guestTeam.addPlayer('X', new Player("Marius", "M",
        new Date(),
        Short.parseShort("1000"),
        Short.parseShort("1000"),
        Short.parseShort("1000"),
        780001,
        7812345)
        );
    guestTeam.addPlayer('Y', new Player("Jeremy", "J", new Date(),
        Short.parseShort("1000"),Short.parseShort("1000"), Short.parseShort("1000"),
        780001, 7812345)
        );
    guestTeam.addPlayer('Z', new Player("Benoit", "B", new Date(),
        Short.parseShort("1000"),Short.parseShort("1000"), Short.parseShort("1000"),
        780001, 7812345)
        );
    guestTeam.addPlayer('R', new Player("Laurent", "L", new Date(),
        Short.parseShort("1000"),Short.parseShort("1000"), Short.parseShort("1000"),
        780001, 7812345)
        );
    guestTeam.addPlayer('S', new Player("Rene", "R", new Date(),
        Short.parseShort("1000"),Short.parseShort("1000"), Short.parseShort("1000"),
        780001, 7812345)
        );
    guestTeam.addPlayer('T', new Player("Gilbert", "G", new Date(),
        Short.parseShort("1000"),Short.parseShort("1000"), Short.parseShort("1000"),
        780001, 7812345)
        );
    guestTeam.addPlayerForBottomDouble('S');
    guestTeam.addPlayerForBottomDouble('T');
    guestTeam.addPlayerForTopDouble('X');
    guestTeam.addPlayerForTopDouble('Y');

    event.generateMatches();
    event.flushMatchList();

    //Clock counter test
View Full Code Here

Examples of de.zelosfan.timedstrategy.team.Team

    public int toScreen = -1;

    public LinkedList<Effect> effects = new LinkedList<>();

    public Game(int mapID) {
        redTeam = new Team(Color.RED, true);
        blueTeam = new Team(Color.BLUE, false);

        world = new World(Main.mapObjectMap.get("map" + mapID));
        Main.gameStateManager.instanceHashMap.put("MapDisplay", new MapDisplay());
        Main.gameStateManager.instanceHashMap.put("UserInterface", new UserInterface());
View Full Code Here

Examples of indexing.Team

        Country france = new Country();
        france.name = "france";
        france.continent = "europe";

        // init Team
        Team barcelone = new Team();
        barcelone.name = "FC Barcelone";
        barcelone.country = espagne;
        barcelone.level = "Ligua";
        barcelone.dateCreate = new Date();
        loadPlayersBarcelone(barcelone);
        barcelone.index();


        Team madrid = new Team();
        madrid.name = "Real Madrid";
        madrid.country = espagne;
        madrid.level = "Ligua";
        madrid.dateCreate = new Date();
        loadPlayersMadrid(madrid);
        madrid.index();


        Team ol = new Team();
        ol.name = "Olympique Lyonnais";
        ol.country = france;
        ol.level = "Ligue 1";
        ol.dateCreate = new Date();
        ol.index();
    }
View Full Code Here

Examples of megamek.common.Team

        int nTeams = game.getNoOfTeams();
        Hashtable<Team, TurnVectors> allTeamTurns = new Hashtable<Team, TurnVectors>(nTeams);
        Hashtable<Team, int[]> evenTrackers = new Hashtable<Team, int[]>(nTeams);
        int numTeamsMoving = 0;
        for (Enumeration<Team> loop = game.getTeams(); loop.hasMoreElements();) {
            final Team team = loop.nextElement();
            allTeamTurns.put(team, team.determineTeamOrder(game));

            // Track both the number of times we've checked the team for
            // "leftover" turns, and the number of "leftover" turns placed.
            int[] evenTracker = new int[2];
            evenTracker[0] = 0;
            evenTracker[1] = 0;
            evenTrackers.put(team, evenTracker);

            // Count this team if it has any "normal" moves.
            if (team.getNormalTurns(game) > 0) {
                numTeamsMoving++;
            }
        }

        // Now, generate the global order of all teams' turns.
        TurnVectors team_order = TurnOrdered.generateTurnOrder(game.getTeamsVector(), game);

        // See if there are any loaded units stranded on immobile transports.
        Enumeration<Entity> strandedUnits = game.getSelectedEntities(new EntitySelector() {
            public boolean accept(Entity entity) {
                if (game.isEntityStranded(entity)) {
                    return true;
                }
                return false;
            }
        });

        // Now, we collect everything into a single vector.
        Vector<GameTurn> turns;

        if (strandedUnits.hasMoreElements() && (game.getPhase() == IGame.Phase.PHASE_MOVEMENT)) {
            // Add a game turn to unload stranded units, if this
            // is the movement phase.
            turns = new Vector<GameTurn>(team_order.getTotalTurns() + team_order.getEvenTurns() + 1);
            turns.addElement(new GameTurn.UnloadStrandedTurn(strandedUnits));
        } else {
            // No stranded units.
            turns = new Vector<GameTurn>(team_order.getTotalTurns() + team_order.getEvenTurns());
        }

        // Walk through the global order, assigning turns
        // for individual players to the single vector.
        // Keep track of how many turns we've added to the vector.
        Team prevTeam = null;
        int min = team_order.getMin();
        for (int numTurn = 0; team_order.hasMoreElements(); numTurn++) {
            Team team = (Team) team_order.nextElement();
            TurnVectors withinTeamTurns = allTeamTurns.get(team);

            int[] evenTracker = evenTrackers.get(team);
            float teamEvenTurns = team.getEvenTurns();

            // Calculate the number of "even" turns to add for this team.
            int numEven = 0;
            if (1 == numTeamsMoving) {
                // The only team moving should move all "even" units.
                numEven += teamEvenTurns;
            } else if (prevTeam == null) {
                // Increment the number of times we've checked for "leftovers".
                evenTracker[0]++;

                // The first team to move just adds the "baseline" turns.
                numEven += teamEvenTurns / min;
            } else if (!team.equals(prevTeam)) {
                // Increment the number of times we've checked for "leftovers".
                evenTracker[0]++;

                // This wierd equation attempts to spread the "leftover"
                // turns accross the turn's moves in a "fair" manner.
View Full Code Here

Examples of megamek.common.Team

                    }
                }
            }
        } else {
            for (Enumeration<Team> i = game.getTeams(); i.hasMoreElements();) {
                final Team team = i.nextElement();

                // If there is only one player, list them as the 'team', and
                // use the team iniative
                if (team.getSize() == 1) {
                    final Player player = team.getPlayers().nextElement();
                    r = new Report(1015, Report.PUBLIC);
                    r.add(player.getName());
                    r.add(team.getInitiative().toString());
                    addReport(r);
                } else {
                    // Multiple players. List the team, then break it down.
                    r = new Report(1015, Report.PUBLIC);
                    r.add(Player.teamNames[team.getId()]);
                    r.add(team.getInitiative().toString());
                    addReport(r);
                    for (Enumeration<Player> j = team.getPlayers(); j.hasMoreElements();) {
                        final Player player = j.nextElement();
                        r = new Report(1015, Report.PUBLIC);
                        r.indent();
                        r.add(player.getName());
                        r.add(player.getInitiative().toString());
View Full Code Here

Examples of megamek.common.Team

     *            The <code>Minefield</code> to be revealed
     */
    private void revealMinefield(Minefield mf) {
        Enumeration<Team> teams = game.getTeams();
        while (teams.hasMoreElements()) {
            Team team = teams.nextElement();
            revealMinefield(team, mf);
        }
    }
View Full Code Here

Examples of megamek.common.Team

    private void checkForRevealMinefield(Minefield mf, Entity layer) {
        Enumeration<Team> teams = game.getTeams();
        //loop through each team and determine if they can see the mine, then loop through players on team
        //and reveal the mine
        while(teams.hasMoreElements()) {
            Team team = teams.nextElement();
            boolean canSee = false;

            //the players own team can always see the mine
            if(team.equals(game.getTeamForPlayer(game.getPlayer(mf.getPlayerId())))) {
                canSee = true;
            } else {
                //need to loop through all entities on this team and find the one with the best shot of seeing
                //the mine placement
                int target = Integer.MAX_VALUE;
                Enumeration<Entity> entities = game.getEntities();
                    while(entities.hasMoreElements()) {
                        Entity en = entities.nextElement();
                        //are we on the right team?
                        if(!team.equals(game.getTeamForPlayer(en.getOwner()))) {
                            continue;
                        }
                        if(LosEffects.calculateLos(game, en.getId(),
                                new HexTarget(mf.getCoords(), game.getBoard(), Targetable.TYPE_HEX_CLEAR)).canSee()) {
                            target = 0;
View Full Code Here

Examples of megamek.common.Team

            int teamId = player.getTeam();

            if (teamId != Player.TEAM_NONE) {
                Enumeration<Team> teams = game.getTeams();
                while (teams.hasMoreElements()) {
                    Team team = teams.nextElement();
                    if (team.getId() == teamId) {
                        Enumeration<Player> players = team.getPlayers();
                        while (players.hasMoreElements()) {
                            Player teamPlayer = players.nextElement();
                            if (teamPlayer.getId() != player.getId()) {
                                send(teamPlayer.getId(), new Packet(Packet.COMMAND_DEPLOY_MINEFIELDS, minefields));
                            }
View Full Code Here

Examples of megamek.common.Team

        Vector<Report> vFullReport = new Vector<Report>();
        vFullReport.add(new Report(5002, Report.PUBLIC));
        int damage_bonus = Math.max(0, game.getPlanetaryConditions().getWindStrength() - PlanetaryConditions.WI_MOD_GALE);
        //cycle through each team and damage 1d6 airborne VTOL/WIGE
        for (Enumeration<Team> loop = game.getTeams(); loop.hasMoreElements();) {
            Team team = loop.nextElement();
            Vector<Integer> airborne = team.getAirborneVTOL();
            if(airborne.size() > 0) {
                //how many units are affected
                int unitsAffected = Math.min(Compute.d6(), airborne.size());
                while((unitsAffected > 0) && (airborne.size() > 0)) {
                    int loc = Compute.randomInt(airborne.size());
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.