1use bevy::prelude::*;
2
3use crate::{
4 events::{Inbox, NetworkEvent, Outbox},
5 server::Server,
6 systems::{handle_events, handle_inbox, handle_incoming, handle_lost, handle_outbox},
7};
8
9pub struct NestPlugin;
10
11impl Plugin for NestPlugin {
12 fn build(&self, app: &mut App) {
13 app.insert_resource(Server::new());
14
15 app.add_event::<NetworkEvent>();
16 app.add_event::<Inbox>();
17 app.add_event::<Outbox>();
18
19 app.add_systems(
20 PreUpdate,
21 (handle_incoming, handle_lost, handle_events, handle_inbox),
22 );
23
24 app.add_systems(Last, handle_outbox);
25 }
26}