added documentation

This commit is contained in:
MaxOhn
2021-01-17 22:11:27 +01:00
parent bbc6698fc7
commit 5e01f867ce
22 changed files with 350 additions and 96 deletions
+4 -6
View File
@@ -33,19 +33,17 @@ fn fruits() {
Err(why) => panic!("Error while parsing map {}: {}", map_id, why),
};
let result = rosu_pp::fruits::PpCalculator::new(&map)
.mods(*mods)
.calculate();
let result = rosu_pp::FruitsPP::new(&map).mods(*mods).calculate();
assert!(
(result.stars - stars).abs() < star_margin * stars,
(result.attributes.stars - stars).abs() < star_margin * stars,
"\nStars:\n\
Calculated: {calculated} | Expected: {expected}\n \
=> {margin} margin ({allowed} allowed)\n\
[map {map} | mods {mods}]\n",
calculated = result.stars,
calculated = result.attributes.stars,
expected = stars,
margin = (result.stars - stars).abs(),
margin = (result.attributes.stars - stars).abs(),
allowed = star_margin * stars,
map = map_id,
mods = mods
+1 -3
View File
@@ -33,9 +33,7 @@ fn mania() {
Err(why) => panic!("Error while parsing map {}: {}", map_id, why),
};
let result = rosu_pp::mania::PpCalculator::new(&map)
.mods(*mods)
.calculate();
let result = rosu_pp::ManiaPP::new(&map).mods(*mods).calculate();
assert!(
(result.stars - stars).abs() < star_margin * stars,
+2 -2
View File
@@ -33,7 +33,7 @@ fn osu_no_sliders() {
Err(why) => panic!("Error while parsing map {}: {}", map_id, why),
};
let result = rosu_pp::osu::PpCalculator::new(&map)
let result = rosu_pp::OsuPP::new(&map)
.mods(*mods)
.calculate(osu::no_sliders_no_leniency::stars);
@@ -90,7 +90,7 @@ fn osu_no_leniency() {
Err(why) => panic!("Error while parsing map {}: {}", map_id, why),
};
let result = rosu_pp::osu::PpCalculator::new(&map)
let result = rosu_pp::osu::OsuPP::new(&map)
.mods(*mods)
.calculate(osu::no_leniency::stars);
+1 -3
View File
@@ -33,9 +33,7 @@ fn taiko() {
Err(why) => panic!("Error while parsing map {}: {}", map_id, why),
};
let result = rosu_pp::taiko::PpCalculator::new(&map)
.mods(*mods)
.calculate();
let result = rosu_pp::TaikoPP::new(&map).mods(*mods).calculate();
assert!(
(result.stars - stars).abs() < star_margin * stars,