public void ReplaceGenerateBoardService(IGenerateBoardService newInstance)
    {
        var index     = MetaComponentsLookup.GenerateBoardService;
        var component = (GenerateBoardServiceComponent)CreateComponent(index, typeof(GenerateBoardServiceComponent));

        component.instance = newInstance;
        ReplaceComponent(index, component);
    }
    public MetaEntity SetGenerateBoardService(IGenerateBoardService newInstance)
    {
        if (hasGenerateBoardService)
        {
            throw new Entitas.EntitasException("Could not set GenerateBoardService!\n" + this + " already has an entity with GenerateBoardServiceComponent!",
                                               "You should check if the context already has a generateBoardServiceEntity before setting it or use context.ReplaceGenerateBoardService().");
        }
        var entity = CreateEntity();

        entity.AddGenerateBoardService(newInstance);
        return(entity);
    }
    public void ReplaceGenerateBoardService(IGenerateBoardService newInstance)
    {
        var entity = generateBoardServiceEntity;

        if (entity == null)
        {
            entity = SetGenerateBoardService(newInstance);
        }
        else
        {
            entity.ReplaceGenerateBoardService(newInstance);
        }
    }
Exemple #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 ReigsterGenerateBoardService(Contexts contexts, IGenerateBoardService viewService)
 {
     _metaContext = contexts.meta;
     _viewService = viewService;
 }