misc_ecs/ecs/component.rs
1use rand::{RngCore, thread_rng};
2use crate::ecs::store::Storage;
3
4///
5///
6/// # Examples
7///
8/// ```
9///
10/// ```
11///
12pub trait Component {
13 type Storage: Storage;
14}
15
16///
17///
18/// # Examples
19///
20/// ```
21///
22/// ```
23///
24#[derive( Eq, Hash, PartialEq, Copy, Clone, Debug)]
25pub struct ComponentID {
26 id: u64,
27}
28
29impl ComponentID {
30
31 pub fn new() -> Self {
32 ComponentID {
33 id: thread_rng().next_u64(),
34 }
35 }
36}