Skip to content

Commit

Permalink
perf: store generated hitresults (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxOhn authored Jul 8, 2024
1 parent 26547d7 commit 272c680
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/catch/performance/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,13 @@ impl<'map> CatchPerformance<'map> {
},
}

self.combo = Some(best_state.max_combo);
self.fruits = Some(best_state.fruits);
self.droplets = Some(best_state.droplets);
self.tiny_droplets = Some(best_state.tiny_droplets);
self.tiny_droplet_misses = Some(best_state.tiny_droplet_misses);
self.misses = Some(best_state.misses);

best_state
}

Expand Down Expand Up @@ -773,7 +780,9 @@ mod test {
state = state.misses(misses);
}

let first = state.generate_state();
let state = state.generate_state();
assert_eq!(first, state);

let expected = brute_force_best(
acc,
Expand Down
9 changes: 9 additions & 0 deletions src/mania/performance/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,13 @@ impl<'map> ManiaPerformance<'map> {
}
}

self.n320 = Some(n320);
self.n300 = Some(n300);
self.n200 = Some(n200);
self.n100 = Some(n100);
self.n50 = Some(n50);
self.misses = Some(misses);

ManiaScoreState {
n320,
n300,
Expand Down Expand Up @@ -1230,7 +1237,9 @@ mod tests {
state = state.misses(misses);
}

let first = state.generate_state();
let state = state.generate_state();
assert_eq!(first, state);

let expected = brute_force_best(
acc,
Expand Down
8 changes: 8 additions & 0 deletions src/osu/performance/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,12 @@ impl<'map> OsuPerformance<'map> {
cmp::min(combo, max_possible_combo)
});

self.combo = Some(max_combo);
self.n300 = Some(n300);
self.n100 = Some(n100);
self.n50 = Some(n50);
self.misses = Some(misses);

OsuScoreState {
max_combo,
n300,
Expand Down Expand Up @@ -1047,7 +1053,9 @@ mod test {
state = state.misses(misses);
}

let first = state.generate_state();
let state = state.generate_state();
assert_eq!(first, state);

let mut expected = brute_force_best(
acc,
Expand Down
7 changes: 7 additions & 0 deletions src/taiko/performance/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,11 @@ impl<'map> TaikoPerformance<'map> {
cmp::min(combo, max_possible_combo)
});

self.combo = Some(max_combo);
self.n300 = Some(n300);
self.n100 = Some(n100);
self.misses = Some(misses);

TaikoScoreState {
max_combo,
n300,
Expand Down Expand Up @@ -642,7 +647,9 @@ mod test {
state = state.misses(misses);
}

let first = state.generate_state();
let state = state.generate_state();
assert_eq!(first, state);

let mut expected = brute_force_best(
acc,
Expand Down

0 comments on commit 272c680

Please sign in to comment.