灵符lingfu

ling-lang

↓ 0 downloads

Ling - The Omniglot Systems Language

Keywords systems, polyglot, ai, crypto, game
lingfu install ling-lang
LicenseApache-2.0 OR MIT
AuthorsLing Lin, Sanny Lin
READMECode / FilesVersionsDependency GraphDependentsSecurityBuildsSettings

Code / Files (995)

crates/ling-game/src/audio.rs
//! Game audio stubs — delegates to ling-audio at runtime.

/// A handle to a loaded sound asset.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct SoundHandle(pub u32);

/// Simple in-game audio mixer state.
#[derive(Debug, Default)]
pub struct AudioMixer {
    next_handle: u32,
}

impl AudioMixer {
    pub fn new() -> Self {
        Self::default()
    }

    /// Register a sound; returns a reusable handle.
    pub fn register(&mut self) -> SoundHandle {
        let h = SoundHandle(self.next_handle);
        self.next_handle += 1;
        h
    }
}

← Back to index