use super::*;
pub trait GameMut {
fn step(&mut self, arguments: &StepArguments);
fn draw(&mut self, arguments: &DrawArguments) -> Image;
fn render_audio(&mut self, arguments: &RenderAudioArguments) -> Sound;
}
pub struct GameMutMap {
game: Box<dyn Game>,
}
impl GameMutMap {
pub fn new(game: Box<dyn Game>) -> Self {
Self { game }
}
}
impl GameMut for GameMutMap {
fn step(&mut self, arguments: &StepArguments) {
self.game.step(arguments)
}
fn draw(&mut self, arguments: &DrawArguments) -> Image {
self.game.draw(arguments)
}
fn render_audio(&mut self, arguments: &RenderAudioArguments) -> Sound {
self.game.render_audio(arguments)
}
}
pub struct RunBundle {
pub game: Box<dyn GameMut>,
pub info: Info,
}
impl RunBundle {
pub fn new(game: Box<dyn GameMut>, info: Info) -> Self {
Self { game, info }
}
}