DEVELOPMENT ENVIRONMENT

~liljamo/deck-builder

ref: 482b3e330398f9c80dbc71021227a12550e1b547 deck-builder/client/src/plugins/async_tasks/mod.rs -rw-r--r-- 1.4 KiB
482b3e33Jonni Liljamo WIP(client): browsing and related call events 1 year, 5 months ago
                                                                                
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
 * This file is part of laurelin_client
 * Copyright (C) 2023 Jonni Liljamo <jonni@liljamo.com>
 *
 * Licensed under GPL-3.0-only.
 * See LICENSE for licensing information.
 */

use bevy::prelude::*;

mod req_login;
pub use req_login::LoginCallEvent;

mod req_register;
pub use req_register::RegisterCallEvent;

mod req_game_create;
pub use req_game_create::GameCreateCallEvent;

mod req_game_forming;
pub use req_game_forming::GameFormingCallEvent;

mod req_game_mygames;
pub use req_game_mygames::GameMyGamesCallEvent;

pub struct AsyncTasksPlugin;

impl Plugin for AsyncTasksPlugin {
    fn build(&self, app: &mut App) {
        app
            .add_event::<LoginCallEvent>()
            .add_event::<RegisterCallEvent>()
            .add_event::<GameCreateCallEvent>()
            .add_event::<GameFormingCallEvent>()
            .add_event::<GameMyGamesCallEvent>()
            .add_systems(
            (
                req_login::start_call,
                req_login::handle_call,
                req_register::start_call,
                req_register::handle_call,
                req_game_create::start_call,
                req_game_create::handle_call,
                req_game_forming::start_call,
                req_game_forming::handle_call,
                req_game_mygames::start_call,
                req_game_mygames::handle_call,
            ).chain()
        );
    }
}