quaver-rs 0.1.0

A Rust library for parsing and analyzing Quaver rhythm game maps
Documentation
use crate::enums::GameMode;

/// Helper functions for game modes
pub struct ModeHelper;

impl ModeHelper {
    /// Maximum key count across all modes
    pub const MAX_KEY_COUNT: i32 = 10;

    /// All available game modes
    pub const ALL_MODES: [GameMode; 10] = [
        GameMode::Keys1,
        GameMode::Keys2,
        GameMode::Keys3,
        GameMode::Keys4,
        GameMode::Keys5,
        GameMode::Keys6,
        GameMode::Keys7,
        GameMode::Keys8,
        GameMode::Keys9,
        GameMode::Keys10,
    ];

    /// Convert game mode to short hand version
    pub fn to_short_hand(mode: GameMode, has_scratch: bool) -> String {
        mode.to_short_hand(has_scratch)
    }

    /// Convert the game mode into the long hand version
    pub fn to_long_hand(mode: GameMode) -> String {
        mode.to_long_hand()
    }

    /// Convert game mode to key count
    pub fn to_key_count(mode: GameMode, has_scratch: bool) -> i32 {
        mode.to_key_count(has_scratch)
    }

    /// Create game mode from key count
    pub fn from_key_count(key_count: i32) -> Result<GameMode, String> {
        GameMode::from_key_count(key_count)
    }

    /// Check if this is a key mode (always true for now)
    pub fn is_key_mode(mode: GameMode) -> bool {
        mode.is_key_mode()
    }

    /// Check if this mode is ranked
    pub fn is_ranked(mode: GameMode) -> bool {
        mode.is_ranked()
    }
}