using DefaultEcs;
using System;
namespace EcsDemo
{
struct Position
public float X;
public float Y;
}
static class Program
static void Main(string[] args)
//create an entity registry
var world = new World();
//create an entity
var entity = world.CreateEntity();
//attach a component
entity.Set(new Position { X = 10f, Y = 20f });
//get the position component from the entity
ref var position = ref entity.Get<Position>();
Console.WriteLine(string.Format("Position: ({0}, {1})", position.X, position.Y));