remove key mods
This commit is contained in:
@@ -4,7 +4,7 @@ A standalone crate to calculate star ratings and performance points for all [osu
|
||||
|
||||
Conversions are generally not supported.
|
||||
|
||||
#### Usage
|
||||
### Usage
|
||||
```rust
|
||||
use std::fs::File;
|
||||
use rosu_pp::{Beatmap, BeatmapExt, GameMode, OsuPP, TaikoPP};
|
||||
@@ -62,7 +62,7 @@ fn main() {
|
||||
|
||||
println!("Stars: {} | PP: {}", result.stars, result.pp);
|
||||
}
|
||||
GameMode::MNA | GameMode::CTB => unimplemented!(),
|
||||
GameMode::MNA | GameMode::CTB => panic!("do your thing"),
|
||||
}
|
||||
|
||||
// If all you want is the map's stars or max pp,
|
||||
@@ -74,12 +74,12 @@ fn main() {
|
||||
}
|
||||
```
|
||||
|
||||
#### osu!standard versions
|
||||
### osu!standard versions
|
||||
- `all_included`: WIP
|
||||
- `no_leniency`: The positional offset of notes created by stack leniency is not considered. This means the jump distance inbetween notes might be slightly off, resulting in small inaccuracies. Since calculating these offsets is relatively expensive though, this version is considerably faster than `all_included`.
|
||||
- `no_slider_no_leniency` (i.e. oppai): In addtion to not considering the positional offset caused by stack leniency, slider paths are also ignored. This means the travel distance of notes is completely omitted which may cause further inaccuracies. Since the slider paths don't have to be computed though, it should generally be faster than `no_leniency`.
|
||||
|
||||
#### Roadmap
|
||||
### Roadmap
|
||||
- osu sr versions
|
||||
- [ ] all included
|
||||
- [x] no_leniency
|
||||
|
||||
+10
-10
@@ -116,14 +116,21 @@ pub use parse::{
|
||||
};
|
||||
|
||||
pub trait BeatmapExt {
|
||||
/// Calculate the stars of a beatmap.
|
||||
///
|
||||
/// For osu!standard maps, the `no_leniency` version will be used.
|
||||
fn stars(&self, mods: impl Mods, passed_objects: Option<usize>) -> f32;
|
||||
|
||||
/// Calculate the max pp of a beatmap if that is all you want.
|
||||
///
|
||||
/// For osu!standard maps, the `no_leniency` version will be used.
|
||||
///
|
||||
/// If you seek more fine-tuning and options you need to match on the map's
|
||||
/// mode and use the mode's corresponding calculator, e.g. [`TaikoPP`](crate::TaikoPP) for taiko.
|
||||
fn max_pp(&self, mods: u32) -> f32;
|
||||
}
|
||||
|
||||
impl BeatmapExt for Beatmap {
|
||||
/// Calculate the stars of a beatmap.
|
||||
///
|
||||
/// For osu!standard maps, the `no_leniency` version will be used.
|
||||
fn stars(&self, mods: impl Mods, passed_objects: Option<usize>) -> f32 {
|
||||
match self.mode {
|
||||
GameMode::STD => osu::no_leniency::stars(self, mods, passed_objects).stars,
|
||||
@@ -132,13 +139,6 @@ impl BeatmapExt for Beatmap {
|
||||
GameMode::CTB => fruits::stars(self, mods, passed_objects).stars,
|
||||
}
|
||||
}
|
||||
|
||||
/// Calculate the max pp of a beatmap if that is all you want.
|
||||
///
|
||||
/// For osu!standard maps, the `no_leniency` version will be used.
|
||||
///
|
||||
/// If you seek more fine-tuning and options you need to match on the map's
|
||||
/// mode and use the mode's corresponding calculator, e.g. [`TaikoPP`](crate::TaikoPP).
|
||||
fn max_pp(&self, mods: u32) -> f32 {
|
||||
match self.mode {
|
||||
GameMode::STD => {
|
||||
|
||||
-30
@@ -18,16 +18,6 @@ pub trait Mods: Copy {
|
||||
const FL: u32 = 1 << 10;
|
||||
const SO: u32 = 1 << 12;
|
||||
|
||||
const K1: u32 = 1 << 26;
|
||||
const K2: u32 = 1 << 27;
|
||||
const K3: u32 = 1 << 28;
|
||||
const K4: u32 = 1 << 15;
|
||||
const K5: u32 = 1 << 16;
|
||||
const K6: u32 = 1 << 17;
|
||||
const K7: u32 = 1 << 18;
|
||||
const K8: u32 = 1 << 19;
|
||||
const K9: u32 = 1 << 24;
|
||||
|
||||
fn change_speed(self) -> bool;
|
||||
fn change_map(self) -> bool;
|
||||
fn speed(self) -> f32;
|
||||
@@ -41,16 +31,6 @@ pub trait Mods: Copy {
|
||||
fn ht(self) -> bool;
|
||||
fn fl(self) -> bool;
|
||||
fn so(self) -> bool;
|
||||
|
||||
fn key1(self) -> bool;
|
||||
fn key2(self) -> bool;
|
||||
fn key3(self) -> bool;
|
||||
fn key4(self) -> bool;
|
||||
fn key5(self) -> bool;
|
||||
fn key6(self) -> bool;
|
||||
fn key7(self) -> bool;
|
||||
fn key8(self) -> bool;
|
||||
fn key9(self) -> bool;
|
||||
}
|
||||
|
||||
impl Mods for u32 {
|
||||
@@ -95,14 +75,4 @@ impl Mods for u32 {
|
||||
impl_mods!(ht, HT);
|
||||
impl_mods!(fl, FL);
|
||||
impl_mods!(so, SO);
|
||||
|
||||
impl_mods!(key1, K1);
|
||||
impl_mods!(key2, K2);
|
||||
impl_mods!(key3, K3);
|
||||
impl_mods!(key4, K4);
|
||||
impl_mods!(key5, K5);
|
||||
impl_mods!(key6, K6);
|
||||
impl_mods!(key7, K7);
|
||||
impl_mods!(key8, K8);
|
||||
impl_mods!(key9, K9);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user