adjusted IGameMode trait

This commit is contained in:
MaxOhn
2024-02-29 22:50:24 +01:00
parent 2c44ef3a35
commit 4731da64dc
9 changed files with 69 additions and 38 deletions
+11 -5
View File
@@ -1,5 +1,3 @@
use std::borrow::Cow;
use rosu_map::{
section::{general::GameMode, hit_objects::CurveBuffers},
util::Pos,
@@ -34,12 +32,20 @@ pub type ManiaBeatmap<'a> = Converted<'a, Mania>;
const MAX_NOTES_FOR_DENSITY: usize = 7;
pub fn try_convert(map: &mut Cow<'_, Beatmap>) -> ConvertStatus {
pub fn check_convert(map: &Beatmap) -> ConvertStatus {
match map.mode {
GameMode::Osu => ConvertStatus::Conversion,
GameMode::Mania => ConvertStatus::Noop,
GameMode::Taiko | GameMode::Catch => ConvertStatus::Incompatible,
}
}
pub fn try_convert(map: &mut Beatmap) -> ConvertStatus {
match map.mode {
GameMode::Osu => {
convert(map.to_mut());
convert(map);
ConvertStatus::Done
ConvertStatus::Conversion
}
GameMode::Mania => ConvertStatus::Noop,
GameMode::Taiko | GameMode::Catch => ConvertStatus::Incompatible,
+5 -3
View File
@@ -1,5 +1,3 @@
use std::borrow::Cow;
use crate::{
any::ModeDifficulty,
model::{
@@ -37,7 +35,11 @@ impl IGameMode for Mania {
type GradualDifficulty = ManiaGradualDifficulty;
type GradualPerformance = ManiaGradualPerformance;
fn try_convert(map: &mut Cow<'_, Beatmap>) -> ConvertStatus {
fn check_convert(map: &Beatmap) -> ConvertStatus {
convert::check_convert(map)
}
fn try_convert(map: &mut Beatmap) -> ConvertStatus {
convert::try_convert(map)
}