public void ReplaceSelectionService(svanderweele.Core.Pieces.Selection.Services.ISelectionService newSelection)
    {
        var index     = MetaComponentsLookup.SelectionService;
        var component = CreateComponent <svanderweele.Core.Pieces.Selection.Services.SelectionServiceComponent>(index);

        component.selection = newSelection;
        ReplaceComponent(index, component);
    }
    public MetaEntity SetSelectionService(svanderweele.Core.Pieces.Selection.Services.ISelectionService newSelection)
    {
        if (hasSelectionService)
        {
            throw new Entitas.EntitasException("Could not set SelectionService!\n" + this + " already has an entity with svanderweele.Core.Pieces.Selection.Services.SelectionServiceComponent!",
                                               "You should check if the context already has a selectionServiceEntity before setting it or use context.ReplaceSelectionService().");
        }
        var entity = CreateEntity();

        entity.AddSelectionService(newSelection);
        return(entity);
    }
    public void ReplaceSelectionService(svanderweele.Core.Pieces.Selection.Services.ISelectionService newSelection)
    {
        var entity = selectionServiceEntity;

        if (entity == null)
        {
            entity = SetSelectionService(newSelection);
        }
        else
        {
            entity.ReplaceSelectionService(newSelection);
        }
    }