safe_ecs 0.1.0

ECS written in safe code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::{Commands, CommandsWithEntity, World};

pub trait Scope {
    fn scope(&self, f: impl FnOnce(&Self)) -> &Self {
        f(self);
        self
    }

    fn scope_mut(&mut self, f: impl FnOnce(&mut Self)) -> &mut Self {
        f(self);
        self
    }
}

impl Scope for Commands<'_> {}
impl Scope for CommandsWithEntity<'_, '_> {}
impl Scope for World {}