I guess I found a solution. This language makes me insane XD
    
    
    ecs.group players:
        comps: CObject
        scope: public
    
    players.handle:
        for e in this.added:
            log e, "added"
        for e in this.removed:
            log e, "removed"
    
    
    
    Run
    
    
    template handle*(self: Group, code: untyped): untyped =
        self.events.add((this :GroupEvent) => code )
    
    
    Run

Reply via email to