kevinresol / exp-ecs

Experimental macro-powered Entity-Component-System game engine
59 stars 5 forks source link

Built-in mechanism to reference other entity/component in a component #7

Open kevinresol opened 4 years ago

kevinresol commented 4 years ago
class TurretTarget extends Component {
    var target:Entity;
    @:of(target) var position:Position;
}

Macro will transform position into var(default, null) and generate setters for target to populate position.

I think this approach would also benefit serializers, as they only need to store the entity reference