public void ReplaceUiManagementService(IUiManagementService newInstance)
    {
        var index     = MetaComponentsLookup.UiManagementService;
        var component = (UiManagementServiceComponent)CreateComponent(index, typeof(UiManagementServiceComponent));

        component.instance = newInstance;
        ReplaceComponent(index, component);
    }
    public MetaEntity SetUiManagementService(IUiManagementService newInstance)
    {
        if (hasUiManagementService)
        {
            throw new Entitas.EntitasException("Could not set UiManagementService!\n" + this + " already has an entity with UiManagementServiceComponent!",
                                               "You should check if the context already has a uiManagementServiceEntity before setting it or use context.ReplaceUiManagementService().");
        }
        var entity = CreateEntity();

        entity.AddUiManagementService(newInstance);
        return(entity);
    }
    public void ReplaceUiManagementService(IUiManagementService newInstance)
    {
        var entity = uiManagementServiceEntity;

        if (entity == null)
        {
            entity = SetUiManagementService(newInstance);
        }
        else
        {
            entity.ReplaceUiManagementService(newInstance);
        }
    }
Ejemplo n.º 4
0
    // public readonly IInputService Input;
    // public readonly IAiService Ai;
    // public readonly IConfigurationService Config;
    // public readonly ICameraService Camera;
    // public readonly IPhysicsService Physics;

    public Services(IViewService view, ITimeService time,
                    IObjectPoolService objectPool, IGenerateBoardService generateBoard,
                    IUiManagementService uiManagement, IGameConfigureService gameConfigure)
    {
        View = view;
        // Application = application;
        Time          = time;
        ObjectPool    = objectPool;
        GenerateBoard = generateBoard;
        UiManagement  = uiManagement;
        GameConfigure = gameConfigure;
        // GameState = gameState;
        // Input = input;
        // Ai = ai;
        //       Config = config;
        // Camera = camera;
        // Physics = physics;
    }
 public RegisterUiManagementServiceSystem(Contexts contexts, IUiManagementService uiManagement)
 {
     _metaContext  = contexts.meta;
     _uiManagement = uiManagement;
 }