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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#![feature(associated_type_defaults)]
extern crate ioc;
#[macro_use] extern crate downcast;
mod primitives;
mod store;
mod id_manager;
mod subsystem;
mod idmgr_mode;
mod process;
mod simulation;
pub use primitives::*;
pub use store::*;
pub use id_manager::*;
pub use subsystem::*;
pub use idmgr_mode::*;
pub use process::*;
pub use simulation::*;
pub mod prelude {
pub use store::{
StoreBase, ComponentStore, ComponentStoreAssignments,
_ComponentStore, _ComponentStoreAssignments,
EntityStore, EntityStoreEntities, StoreWithDirtyState,
_EntityStoreEntities, _StoreWithDirtyState,
};
pub use id_manager::PrimaryIdManager;
}
pub mod macros;
use std::fmt::Debug;
pub fn destroy_entity<IdMgr, Key, StoBase: ?Sized>(
ids: &mut IdMgr,
stores: &mut ioc::ServiceWriteGuardMap<Key, StoBase>,
id: IdMgr::Id,
) -> bool
where
Key: Debug + Ord,
IdMgr: PrimaryIdManager,
StoBase: StoreBase<Id = IdMgr::Id>,
{
match ids.validate(id) {
Some(v_id) => {
for (_, store) in stores {
store.release_drop(v_id);
}
}
None => return false
}
unsafe { ids.invalidate(id) }
}