Exemplo n.º 1
0
    public void ReplaceGameConfigure(IGameConfigureService newInstance)
    {
        var index     = MetaComponentsLookup.GameConfigure;
        var component = (GameConfigureComponent)CreateComponent(index, typeof(GameConfigureComponent));

        component.instance = newInstance;
        ReplaceComponent(index, component);
    }
Exemplo n.º 2
0
    public MetaEntity SetGameConfigure(IGameConfigureService newInstance)
    {
        if (hasGameConfigure)
        {
            throw new Entitas.EntitasException("Could not set GameConfigure!\n" + this + " already has an entity with GameConfigureComponent!",
                                               "You should check if the context already has a gameConfigureEntity before setting it or use context.ReplaceGameConfigure().");
        }
        var entity = CreateEntity();

        entity.AddGameConfigure(newInstance);
        return(entity);
    }
Exemplo n.º 3
0
    public void ReplaceGameConfigure(IGameConfigureService newInstance)
    {
        var entity = gameConfigureEntity;

        if (entity == null)
        {
            entity = SetGameConfigure(newInstance);
        }
        else
        {
            entity.ReplaceGameConfigure(newInstance);
        }
    }
Exemplo 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 RegisterGameConfigureSystem(Contexts contexts, IGameConfigureService gameConfigureService)
 {
     _metaContext = contexts.meta;
     _service     = gameConfigureService;
 }