コード例 #1
0
  @Override
  public void playMatch() {
    calcShoots();

    AverageLocation loc;
    Integer teamShoots;
    StadisticsTeam teamShooter;
    StadisticsTeam teamKilled;

    Goals gs;
    Assistances as;
    Injuries ls;

    // Calculo de los tiros que han sido gol por cada equipo
    for (int t = 0; t < 2; t++) {
      if (t == 0) {
        loc = AverageLocation.HOME;
        teamShoots = shoots.get(POS_HOME);
        teamShooter = stadistics.getHome();
        teamKilled = stadistics.getAway();
      } else {
        loc = AverageLocation.AWAY;
        teamShoots = shoots.get(POS_AWAY);
        teamShooter = stadistics.getAway();
        teamKilled = stadistics.getHome();
      }

      gs = new GoalsImpl(this, teamShooter, teamKilled, loc);

      for (int s = 0; s < teamShoots; s++) {
        gs.calcGoal();
      }

      if (teamShooter.isPlayerTeam()) {
        // Asistencias
        as = new AssistancesImpl(teamShooter);

        for (Integer s = 0; s < getMyGoals(teamShooter.getTeam()); s++) {
          as.calcAssis(s);
        }

        // Lesiones
        ls = new InjuriesImpl(teamShooter);

        ls.calcInjuries();
      }
    }
  }
コード例 #2
0
  public static ApplicationSettings defaultApplicationSettings() {
    ApplicationSettings applicationSettings = new ApplicationSettings();
    Goals pluginAwareGoals = new Goals();
    pluginAwareGoals.add("jetty:run");
    pluginAwareGoals.add("tomcat:run");
    pluginAwareGoals.add("tomcat5:run");
    pluginAwareGoals.add("tomcat6:run");
    pluginAwareGoals.add("tomcat7:run");
    applicationSettings.setPluginAwareGoals(pluginAwareGoals);

    Goals goals = new Goals();
    for (String basicPhase : BASIC_PHASES) {
      goals.add(new Goal(basicPhase));
    }
    goals.add(new Goal("clean install"));
    applicationSettings.setGoals(goals);
    applicationSettings.setVersion(ACTUAL_VERSION);
    return applicationSettings;
  }
コード例 #3
0
 public List<Goal> getAllGoals() {
   List<Goal> allGoals = new ArrayList<Goal>(goals.size() + pluginAwareGoals.size());
   allGoals.addAll(goals.getGoals());
   allGoals.addAll(pluginAwareGoals.getGoals());
   return allGoals;
 }