Skip to content

Commit

Permalink
dev: added PlayType to base plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
roboteng committed Nov 23, 2023
1 parent e6333ca commit 4c6e2ff
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions game/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pub mod main_menu;
pub mod settings_page;

#[derive(Default)]
pub struct BasePlugin(GameState);
pub struct BasePlugin(GameState, PlayType);
impl Plugin for BasePlugin {
fn build(&self, app: &mut bevy::prelude::App) {
app.add_state::<GameState>()
Expand All @@ -25,8 +25,8 @@ impl Plugin for BasePlugin {
}

impl BasePlugin {
pub fn new(init_state: GameState) -> Self {
Self(init_state)
pub fn new(init_state: GameState, play: PlayType) -> Self {
Self(init_state, play)
}
}

Expand Down
2 changes: 1 addition & 1 deletion game/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ fn main() {
App::new()
.add_plugins((
DefaultPlugins,
BasePlugin::new(GameState::MainMenu),
BasePlugin::new(GameState::MainMenu, PlayType::None),
MainMenuPlugin,
SettingsPlugin,
InGamePlugin,
Expand Down
2 changes: 1 addition & 1 deletion game_server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ fn main() {
App::new()
.add_plugins((
DefaultPlugins,
BasePlugin::new(GameState::MainMenu),
BasePlugin::new(GameState::InGame, PlayType::Server),
InGamePlugin,
))
.run();
Expand Down

0 comments on commit 4c6e2ff

Please sign in to comment.