-
Notifications
You must be signed in to change notification settings - Fork 54
/
main.cpp
44 lines (36 loc) · 863 Bytes
/
main.cpp
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
#include <UECS/UECS.hpp>
#include <iostream>
using namespace Ubpa::UECS;
using namespace Ubpa;
using namespace std;
struct A {};
struct B {};
struct C {};
struct D {};
struct E {};
struct F {};
struct G {};
struct MySystem {
static void OnUpdate(Schedule& schedule) {
ArchetypeFilter filter;
filter.all = { AccessTypeID_of<D> };
filter.any = { AccessTypeID_of<E>, AccessTypeID_of<F> };
filter.none = { TypeID_of<G> };
schedule.RegisterEntityJob(
[](LastFrame<A> a, Write<B> b, Latest<C> c) {},
"System Func",
true,
filter
);
}
};
int main() {
World w;
w.entityMngr.cmptTraits.Register<A, B, C, D, E, F, G>();
w.systemMngr.RegisterAndActivate<MySystem>();
w.entityMngr.Create(Ubpa::TypeIDs_of<A, B, C, D, E>);
w.Update();
cout << w.DumpUpdateJobGraph() << endl;
cout << w.GenUpdateFrameGraph().Dump() << endl;
return 0;
}