Beispiel #1
0
 public static void removedFromTeam(ArenaTeam team, Player player) {
   HeroParty party = parties.get(team);
   if (party == null) {
     return;
   }
   Hero hero = getHero(player);
   if (hero == null) {
     return;
   }
   removeOldParty(hero, null);
 }
Beispiel #2
0
  public static void addedToTeam(ArenaTeam team, Player player) {
    HeroParty party = parties.get(team);
    if (party == null) party = createTeam(team);

    Hero hero = getHero(player);
    if (hero == null) return;

    removeOldParty(hero, party);

    if (party == null) {
      party = createParty(team, hero);
    }

    /// Add the hero to the party,
    /// and the tell the hero which party they are in
    party.addMember(hero);
    hero.setParty(party);
  }
Beispiel #3
0
  public static HeroParty createTeam(ArenaTeam team) {
    HeroParty party = null;
    for (ArenaPlayer player : team.getPlayers()) {
      Hero hero = getHero(player.getPlayer());
      if (hero == null) continue;

      removeOldParty(hero, null); // / Remove from any old parties
      /// if the party doesnt exist create it
      if (party == null) {
        party = createParty(team, hero);
      }
      /// Add the hero to the party,
      /// and the tell the hero which party they are in
      party.addMember(hero);
      hero.setParty(party);
    }
    return party;
  }