Exemple #1
0
 /// <summary>
 /// Registers a callback for converting a <see cref="Render"/> component to an <see cref="Engine"/> representation.
 /// </summary>
 /// <typeparam name="TComponent">The specific type of <see cref="Render"/> component to handle.</typeparam>
 /// <param name="create">The callback for mapping a <see cref="Render"/> component to an <see cref="Engine"/> representation.</param>
 protected void RegisterRenderComponent <TComponent>(RenderCompononentToEngine <TComponent> create)
     where TComponent : Render
 {
     RenderablesSync.RegisterMultiple <Entity, PositionableRenderable>(
         element => element.TemplateData.Render.OfType <TComponent>().Select(component => create(element, component)),
         UpdateRepresentation);
 }