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
/// Spawn an entity with some components already set.
/// Returns a `Result` containing the entity or a `ComponentAddError`.
///
/// Example:
/// ```
/// use secsy_ecs::world::*;
/// use secsy_ecs::entities::*;
///
/// let mut w = World::new();
///
/// let e = secsy_ecs::spawn_entity_with!(w, 621, 621.0)
/// .expect("One of added components already exists");
/// let _f = secsy_ecs::spawn_entity_with!(w, 621, 621.0)
/// .expect("One of added components already exists");
///
/// assert_eq!(w.get::<i32>(e).unwrap(), 621);
/// assert_eq!(w.get::<f64>(e).unwrap(), 621.0);
///```