Skip to content

Commit

Permalink
[update/history] stage pointers added to history
Browse files Browse the repository at this point in the history
  • Loading branch information
Lorenzo Affetti committed Oct 16, 2015
1 parent bcdfa7a commit b003c70
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,23 @@ public void save() {
data.setIndex6_playerContributionPerStage(playerContributionPerStage());
data.setIndex7_balancePerStage(balancePerStage());
data.setIndex8_playerContributionStabilityPerStage(playerContributionStabilityPerStage());
data.setHistory(history);
data.setRatios();

data.setHistory(history);
data.setStageEndings(stageEndings());

fbRef.setValue(data);
}

private List<Integer> stageEndings() {
// actually stagePtrs marks stage beginnings, so:
List<Integer> stageEndings = new ArrayList<>();
for (Integer i : stagePtrs) {
stageEndings.add(i - 1);
}
return stageEndings;
}

private int noStages() {
return stagePtrs.size();
}
Expand Down Expand Up @@ -400,6 +411,10 @@ private class Data {
@Getter
@Setter
private List<Record> history;
// stage endings
@Getter
@Setter
private List<Integer> stageEndings;
// 1- Tempo complessivo di gioco
@Getter
@Setter
Expand Down

0 comments on commit b003c70

Please sign in to comment.