aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
blob: 6b4650227eb0a522de80ccb4566e509500a35a56 (plain)
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
#![warn(missing_docs)]

//! Plugin for bevy engine enabling interaction with and representation of the file system in the world.

use std::path::PathBuf;

use bevy::prelude::*;
use events::DirworldNavigationEvent;
use resources::{Dirworld, DirworldConfig};

/// Components used by this plugin
pub mod components;

/// Events used by this plugin
pub mod events;

/// Resources used by this plugin
pub mod resources;

/// Plugin which enables high-level interaction
pub struct DirworldPlugin {
    /// Root path of world
    pub path: PathBuf,
}

impl Plugin for DirworldPlugin {
    fn build(&self, app: &mut App) {
        app.insert_resource(DirworldConfig::new(self.path.clone()))
            .add_event::<DirworldNavigationEvent>()
            .init_resource::<Dirworld>();
    }
}