Sadly it doesn't work out of the box but it is possible using macros to 
generate the `ImportantStuff` type and `get` proc automatically.
    
    
    type ImportantStuff = object
        littleMember_int: seq[int]
        littleMember_float: seq[float]
        littleMember_ComponentTypeA: seq[ComponentTypeA]
    
    func get[T](a: ImportantStuff, i: int): T =
        when T is float: a.littleMember_float[i]
        elif T is int: a.littleMember_int[i]
        elif T is ComponentTypeA: a.littleMember_ComponentTypeA[i]
    
    
    Run

could in theory be created by:
    
    
    ecsMacro(ImportantStuff, int, float, ComponentA)
    
    
    Run

I don't have the time right now, but unless someone else does it before me I 
could try and write an example of how the `ecsMacro` could be implemented later 
tonight. 

Reply via email to