-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
37 lines (29 loc) · 1009 Bytes
/
Program.cs
File metadata and controls
37 lines (29 loc) · 1009 Bytes
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
using System;
using System.Threading;
using Cid = System.UInt16;
namespace EntityFu {
class Program
{
static Cid _id = 0;
static void Main(string[] args) {
//Give Components a cId
EntityComponent.HealthComponent.cid = _id++;
EntityFu.Component.numCids = _id; //total number of cids
//Create a new entity and add a HealthComponent to it
EntityFu.create(
new EntityComponent.HealthComponent(10, 100)
);
EntityFu.create(
new EntityComponent.HealthComponent(5, 50)
);
//Example usage, take away 1 health point every second.
while (EntityFu.count() > 0) {
EntitySystem.HealthSystem.tick(0.1);
Thread.Sleep(1000);
}
//We're done. Destroy it.
EntityFu.dealloc();
Console.ReadLine();
}
}
}