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
//! A social deduction, historically based card game
//! Very cool game

use bevy::prelude::*;
use bevy_asset_loader::loading_state::{
    config::ConfigureLoadingState, LoadingState, LoadingStateAppExt,
};
// use bevy_editor_pls::prelude::*;
use tracing_subscriber::EnvFilter;

mod cards;
mod design_complexity;
mod logo;
mod menu;
mod networking;
mod player;
mod rooms;

#[derive(Debug, Clone, Copy, Default, Eq, PartialEq, Hash, States)]
pub enum AppState {
    #[default]
    LoadingLogo,
    Logo,
    LoadingMenu,
    Menu,
    Rooms,
    InGame,
}

fn main() {
    let _ = tracing_subscriber::fmt()
        .with_env_filter(EnvFilter::from_default_env())
        .try_init();

    App::new()
        .init_state::<AppState>()
        .add_loading_state(
            LoadingState::new(AppState::LoadingLogo)
                .continue_to_state(AppState::Logo)
                .load_collection::<logo::LogoAssets>(),
        )
        .add_loading_state(
            LoadingState::new(AppState::LoadingMenu)
                .continue_to_state(AppState::Menu)
                .load_collection::<menu::MenuAssets>(),
        )
        .add_plugins((
            DefaultPlugins,
            logo::LogoPlugin,
            menu::MenuPlugin,
            rooms::RoomsPlugin,
        ))
        .add_plugins(bevy_egui::EguiPlugin)
        // .add_plugins(EditorPlugin::default())
        .run();
}