コード例 #1
0
 public static IMutation[] getMutations(IMutationRules rules) {
   final List<IMutation> mutations = newArrayList();
   mutations.addAll(getSecondEditionMutations());
   List<IMutation> toRemove = new ArrayList<IMutation>();
   for (IMutation mutation : mutations) {
     if (!rules.acceptMutation(mutation)) {
       toRemove.add(mutation);
     }
   }
   mutations.removeAll(toRemove);
   return mutations.toArray(new IMutation[mutations.size()]);
 }
コード例 #2
0
  public static IMutation[] getMutations(IExaltedEdition edition, IMutationRules rules) {
    List<IMutation> mutations = null;
    List<IMutation> toRemove = new ArrayList<IMutation>();
    if (edition == ExaltedEdition.FirstEdition) {
      mutations = getFirstEditionMutations();
    }
    if (edition == ExaltedEdition.SecondEdition) {
      mutations = getSecondEditionMutations();
    }

    for (IMutation mutation : mutations) {
      if (!rules.acceptMutation(mutation)) {
        toRemove.add(mutation);
      }
    }

    mutations.removeAll(toRemove);

    return mutations.toArray(new IMutation[mutations.size()]);
  }