2022-02-03 10:17:02 -05:00
|
|
|
#[cfg(target_arch = "wasm32")]
|
2022-02-03 09:45:29 -05:00
|
|
|
#[macro_use]
|
|
|
|
mod single_thread;
|
|
|
|
|
2022-02-03 10:17:02 -05:00
|
|
|
#[cfg(not(target_arch = "wasm32"))]
|
|
|
|
#[macro_use]
|
|
|
|
mod multi_thread;
|
|
|
|
|
2022-02-03 09:45:29 -05:00
|
|
|
use ::specs::prelude::World;
|
2022-02-03 10:17:02 -05:00
|
|
|
#[cfg(not(target_arch = "wasm32"))]
|
|
|
|
pub use multi_thread::*;
|
|
|
|
#[cfg(target_arch = "wasm32")]
|
2022-02-03 09:45:29 -05:00
|
|
|
pub use single_thread::*;
|
|
|
|
|
|
|
|
use super::*;
|
|
|
|
|
|
|
|
pub trait UnifiedDispatcher {
|
|
|
|
fn run_now(&mut self, ecs: *mut World);
|
|
|
|
}
|
|
|
|
|
|
|
|
construct_dispatcher!(
|
|
|
|
(MapIndexingSystem, "map_index", &[]),
|
|
|
|
(VisibilitySystem, "visibility", &[]),
|
|
|
|
(EncumbranceSystem, "encumbrance", &[]),
|
|
|
|
(InitiativeSystem, "initiative", &[]),
|
|
|
|
(TurnStatusSystem, "turnstatus", &[]),
|
|
|
|
(QuipSystem, "quips", &[]),
|
|
|
|
(AdjacentAI, "adjacent", &[]),
|
|
|
|
(VisibleAI, "visible", &[]),
|
|
|
|
(ApproachAI, "approach", &[]),
|
|
|
|
(FleeAI, "flee", &[]),
|
|
|
|
(ChaseAI, "chase", &[]),
|
|
|
|
(DefaultMoveAI, "default_move", &[]),
|
|
|
|
(MovementSystem, "movement", &[]),
|
|
|
|
(TriggerSystem, "triggers", &[]),
|
|
|
|
(MeleeCombatSystem, "melee", &[]),
|
|
|
|
(RangedCombatSystem, "ranged", &[]),
|
|
|
|
(ItemCollectionSystem, "pickup", &[]),
|
|
|
|
(ItemEquipOnUse, "equip", &[]),
|
|
|
|
(ItemUseSystem, "use", &[]),
|
|
|
|
(SpellUseSystem, "spells", &[]),
|
|
|
|
(ItemIdentificationSystem, "itemid", &[]),
|
|
|
|
(ItemDropSystem, "drop", &[]),
|
|
|
|
(ItemRemoveSystem, "remove", &[]),
|
|
|
|
(HungerSystem, "hunger", &[]),
|
|
|
|
(ParticleSpawnSystem, "particle_spawn", &[]),
|
|
|
|
(LightingSystem, "lighting", &[])
|
|
|
|
);
|
|
|
|
|
|
|
|
pub fn new() -> Box<dyn UnifiedDispatcher + 'static> {
|
|
|
|
new_dispatch()
|
|
|
|
}
|