/*
* 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(),
);
}
}