expose BeatmapExt methods for mode-specific objects (#20)

* expose osu hitobjects

* added pub method to create osu objects

* expose mania objects

* added some derived traits to public types

* expose taiko objects

* expose catch objects

* add documentation

* fix documentation
This commit is contained in:
MaxOhn
2023-01-28 04:33:05 +01:00
committed by GitHub
parent cdb0bbb8f4
commit fb36edd132
11 changed files with 294 additions and 112 deletions
+10 -6
View File
@@ -5,13 +5,17 @@ use super::fruit_or_juice::FruitParams;
const PLAYFIELD_WIDTH: f32 = 512.0;
const BASE_SPEED: f64 = 1.0;
#[derive(Clone, Debug)]
/// A [`HitObject`](crate::parse::HitObject) that was processed for the osu!ctb gamemode.
#[derive(Clone, Debug, PartialEq)]
pub struct CatchObject {
pub(crate) pos: f32,
pub(crate) time: f64,
pub(crate) hyper_dash: bool,
pub(crate) hyper_dist: f32,
/// The X position of the object.
pub pos: f32,
/// The time of the object.
pub time: f64,
/// Whether the object is a hyper dash.
pub hyper_dash: bool,
/// The hyper distance to the next object
pub hyper_dist: f32,
}
impl CatchObject {
+6 -7
View File
@@ -6,20 +6,19 @@ mod gradual_performance;
mod movement;
mod pp;
use catch_object::CatchObject;
use difficulty_object::DifficultyObject;
use fruit_or_juice::FruitOrJuice;
pub use gradual_difficulty::*;
pub use gradual_performance::*;
use movement::Movement;
pub use pp::*;
use crate::{catch::fruit_or_juice::FruitParams, curve::CurveBuffers, Beatmap, Mods, OsuStars};
pub use self::{catch_object::CatchObject, gradual_difficulty::*, gradual_performance::*, pp::*};
pub(crate) use self::fruit_or_juice::{FruitOrJuice, FruitParams};
use crate::{curve::CurveBuffers, Beatmap, Mods, OsuStars};
const SECTION_LENGTH: f64 = 750.0;
const STAR_SCALING_FACTOR: f64 = 0.153;
const ALLOWED_CATCH_RANGE: f32 = 0.8;
pub(crate) const ALLOWED_CATCH_RANGE: f32 = 0.8;
const CATCHER_SIZE: f32 = 106.75;
/// Difficulty calculator on osu!catch maps.