sillyecs
A silly little compile-time generated archetype ECS in Rust.
Installation
sillyecs is a build-time dependency. To use it, add this to your Cargo.toml:
[]
= "0.0.1"
Usage
Define your ECS components and systems in a YAML file:
# ecs.yaml
components:
- name: Position
- name: Velocity
- name: Health
- name: Collider
archetypes:
- name: Particle
description: A particle system particle.
components:
- Position
- Velocity
- name: Player
components:
- Position
- Velocity
- Health
- name: ForegroundObject
components:
- Position
- Collider
promotions:
- BackgroundObject
- name: BackgroundObject
components:
- Position
promotions:
- ForegroundObject
phases:
- name: Startup
- name: FixedUpdate
- name: Update
- name: Render
systems:
- name: Physics
phase: FixedUpdate
inputs:
- Velocity
outputs:
- Position
- name: Render
phase: Render
inputs:
- Position
Use sillyecs in your build.rs:
use EcsCode;
use File;
use BufReader;
Include the compile-time generated files:
include!;
include!;
include!;
include!;
The compiler will tell you which traits and functions to implement.