public void ReplaceGameConfigure(IGameConfigureService newInstance) { var index = MetaComponentsLookup.GameConfigure; var component = (GameConfigureComponent)CreateComponent(index, typeof(GameConfigureComponent)); component.instance = newInstance; ReplaceComponent(index, component); }
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); }
public void ReplaceGameConfigure(IGameConfigureService newInstance) { var entity = gameConfigureEntity; if (entity == null) { entity = SetGameConfigure(newInstance); } else { entity.ReplaceGameConfigure(newInstance); } }
// 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; }