1use super::*;
5
6pub trait GameMut {
8 fn step(&mut self, arguments: &StepArguments);
9 fn draw(&mut self, arguments: &DrawArguments) -> Image;
10 fn render_audio(&mut self, arguments: &RenderAudioArguments) -> Sound;
11}
12
13pub struct GameMutMap {
15 game: Box<dyn Game>,
16}
17
18impl GameMutMap {
19 pub fn new(game: Box<dyn Game>) -> Self {
20 Self { game }
21 }
22}
23
24impl GameMut for GameMutMap {
25 fn step(&mut self, arguments: &StepArguments) {
26 self.game.step(arguments)
27 }
28 fn draw(&mut self, arguments: &DrawArguments) -> Image {
29 self.game.draw(arguments)
30 }
31 fn render_audio(&mut self, arguments: &RenderAudioArguments) -> Sound {
32 self.game.render_audio(arguments)
33 }
34}
35
36pub struct RunBundle {
38 pub game: Box<dyn GameMut>,
39 pub info: Info,
40}
41
42impl RunBundle {
43 pub fn new(game: Box<dyn GameMut>, info: Info) -> Self {
44 Self { game, info }
45 }
46}