예제 #1
0
파일: Fight.java 프로젝트: Neraloth/d2j
 public void foreach(FightHandlerAction action) throws FightException {
   if (state == FightStateEnum.ACTIVE) {
     for (IFighter fighter : fighters) {
       action.call(fighter.getHandler());
     }
   } else {
     for (IFighter fighter : challengers) {
       action.call(fighter.getHandler());
     }
     for (IFighter fighter : defenders) {
       action.call(fighter.getHandler());
     }
   }
 }
예제 #2
0
파일: Fight.java 프로젝트: Neraloth/d2j
  public void foreachTeam(FightTeamEnum team, FightHandlerAction action) throws FightException {
    switch (team) {
      case CHALLENGER:
        for (IFighter fighter : challengers) {
          action.call(fighter.getHandler());
        }
        break;

      case DEFENDER:
        for (IFighter fighter : defenders) {
          action.call(fighter.getHandler());
        }
        break;

      case SPECTATOR:
        break;
    }
  }