DEVELOPMENT ENVIRONMENT

~liljamo/deck-builder

ref: b8bd27dd7fcbade514bc75433e7a0ed068be3f65 deck-builder/client/src/plugins/async_tasks/mod.rs -rw-r--r-- 2.5 KiB
b8bd27ddJonni Liljamo feat(client): finish new refresh, impl game lock 1 year, 7 months ago
                                                                                
443c9b0c skye
443c9b0c skye
78241f7b skye
443c9b0c skye
443c9b0c skye
78241f7b skye
78241f7b skye
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/*
 * 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_join;
pub use req_game_join::GameJoinCallEvent;

mod req_game_forming;
pub use req_game_forming::GameFormingCallEvent;

mod req_game_mygames;
pub use req_game_mygames::GameMyGamesCallEvent;

mod req_game_details;
pub use req_game_details::GameDetailsCallEvent;

mod req_game_action_create;
pub use req_game_action_create::GameActionCreateCallEvent;

mod parse_game_status;
pub use parse_game_status::ParseGameStatusEvent;

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::<GameJoinCallEvent>()
            .add_event::<GameFormingCallEvent>()
            .add_event::<GameMyGamesCallEvent>()
            .add_event::<GameDetailsCallEvent>()
            .add_event::<GameActionCreateCallEvent>()
            .add_event::<ParseGameStatusEvent>()
            .add_systems(
                (
                    req_login::start_call,
                    req_login::handle_call,
                    req_register::start_call,
                    req_register::handle_call,
                )
                    .chain(),
            )
            .add_systems(
                (
                    req_game_create::start_call,
                    req_game_create::handle_call,
                    req_game_join::start_call,
                    req_game_join::handle_call,
                    req_game_forming::start_call,
                    req_game_forming::handle_call,
                    req_game_mygames::start_call,
                    req_game_mygames::handle_call,
                    req_game_details::start_call,
                    req_game_details::handle_call,
                    req_game_action_create::start_call,
                    req_game_action_create::handle_call,
                )
                    .chain(),
            )
            .add_systems(
                (
                    parse_game_status::start_call,
                    parse_game_status::handle_call,
                )
                    .chain(),
            );
    }
}