public void Run() { stateManager.Start(gameStates[Mode.Regular]); stateManager.ChangeState(gameStates[Mode.Build]); signalBus.Publish <SwitchGameModeSignal>(gameModeSignals[Mode.Build]); signalBus.Subscribe <SwitchGameModeSignal>(SwitchMode); }
private void SwitchMode() { switch (gameMode.CurrentMode) { case Mode.Build: signalBus.Publish <SwitchGameModeSignal>(regularGameSignal); break; case Mode.Regular: signalBus.Publish <SwitchGameModeSignal>(buildGameSignal); break; } }
private void SendUpdateSignal() { var resources = new ResourcesData() { Gold = Gold, Steel = Steel, Wood = Wood }; signalBus.Publish <UpdateResourcesSignal>(new UpdateResourcesSignal(resources)); }
private void AddResources() { signalBus.Publish <TryAddResourceSignal>(new TryAddResourceSignal(data.Production.Quantity)); }