Skip to content

Commit

Permalink
feat: configuration using events. move identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
simonas-notcat committed Dec 12, 2023
1 parent fb81f7f commit 4ec6eaf
Show file tree
Hide file tree
Showing 5 changed files with 221 additions and 148 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ env:
# update with the name of the main binary
binary: graph-view
add_binaries_to_github_release: true
itch_target: simonas-notcat/graph-view-bevy-jam-4
itch_target: simonas-notcat/graph-view


jobs:
Expand Down
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,7 @@ opt-level = 1

[profile.dev.package."bevy-inspector-egui"]
opt-level = 1

[lints.clippy]
type_complexity = "allow"
too_many_arguments = "allow"
18 changes: 17 additions & 1 deletion src/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,27 @@ pub struct SelectRandomIdentifierEvent;
#[derive(Event, Debug)]
pub struct SelectRandomConnectedIdentifierEvent;

#[derive(Event, Debug)]
pub struct MoveIdentifiersRndEvent;

#[derive(Event, Debug)]
pub struct AddIdentifiersEvent {
pub count: u32,
}

#[derive(Event, Debug)]
pub struct AddConnectionsEvent {
pub count: u32,
}

pub struct EventsPlugin;

impl Plugin for EventsPlugin {
fn build(&self, app: &mut App) {
app.add_event::<SelectRandomIdentifierEvent>()
.add_event::<SelectRandomConnectedIdentifierEvent>();
.add_event::<SelectRandomConnectedIdentifierEvent>()
.add_event::<AddIdentifiersEvent>()
.add_event::<MoveIdentifiersRndEvent>()
.add_event::<AddConnectionsEvent>();
}
}
4 changes: 0 additions & 4 deletions src/resources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,15 @@ use bevy_inspector_egui::prelude::*;
#[derive(Reflect, Resource, InspectorOptions)]
#[reflect(Resource, InspectorOptions)]
pub struct Configuration {
pub identifiers: u32,
pub container_size: f32,
pub animation_duration: u64,
pub connections: u32,
}

impl Default for Configuration {
fn default() -> Self {
Self {
identifiers: 8000,
container_size: 30.0,
animation_duration: 6,
connections: 30000,
}
}
}
Loading

0 comments on commit 4ec6eaf

Please sign in to comment.