summaryrefslogtreecommitdiff
path: root/ecs/src/phase.rs
blob: 9e3be24e79067a942607adb9e731429ee3f6533f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use ecs_macros::Component;

use crate::pair::{ChildOf, Pair};
use crate::{declare_entity, World};

#[derive(Debug, Default, Clone, Copy, Component)]
pub struct Phase;

declare_entity!(pub START, (Phase,));
declare_entity!(pub PRE_UPDATE, (Phase,));
declare_entity!(pub UPDATE, (Phase, Pair::builder().relation::<ChildOf>().target_id(*PRE_UPDATE).build()));

#[doc(hidden)]
pub(crate) fn spawn_entities(world: &mut World)
{
    world.create_declared_entity(&START);
    world.create_declared_entity(&PRE_UPDATE);
    world.create_declared_entity(&UPDATE);
}