mod components;
mod systems;

use bevy::prelude::{App, Plugin, StartupStage};
use bevy_rapier3d::prelude::Group;

pub use self::components::*;
use self::systems::spawn_cyberbike;

pub const BIKE_BODY_COLLISION_GROUP: (Group, Group) = (Group::GROUP_1, Group::GROUP_1);
pub const BIKE_WHEEL_COLLISION_GROUP: (Group, Group) = (Group::GROUP_10, Group::GROUP_10);

pub struct CyberBikePlugin;
impl Plugin for CyberBikePlugin {
    fn build(&self, app: &mut App) {
        app.insert_resource(WheelConfig::default())
            .register_type::<WheelConfig>()
            .add_startup_system_to_stage(StartupStage::PostStartup, spawn_cyberbike);
    }
}
