1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
use input;
use {
EventMap,
IdleArgs,
RenderArgs,
AfterRenderArgs,
UpdateArgs,
};
use Event::{ Idle, Render, AfterRender, Update, Input };
#[derive(Clone, PartialEq, Debug)]
pub enum Event<I = input::Input> {
Render(RenderArgs),
AfterRender(AfterRenderArgs),
Update(UpdateArgs),
Idle(IdleArgs),
Input(I),
}
impl<I> EventMap<I> for Event<I> {
fn render(args: RenderArgs) -> Event<I> { Render(args) }
fn after_render(args: AfterRenderArgs) -> Event<I> { AfterRender(args) }
fn update(args: UpdateArgs) -> Event<I> { Update(args) }
fn idle(args: IdleArgs) -> Event<I> { Idle(args) }
fn input(args: I) -> Event<I> { Input(args) }
}