public BattleInitialization(IGeneratorDungeon generatorDungeon, IReactiveProperty <EnumBattleWindow> battleState, IReactiveProperty <EnumMainWindow> activeWindow, IPlayerView player) { _player = player; _generatorDungeon = generatorDungeon; _battleState = battleState; _activeWindow = activeWindow; }
public void SetReference(IGeneratorDungeon generatorDungeon) { _generatorDungeon = generatorDungeon; IntoBattleButton.OnPointerClickAsObservable().Subscribe(_ => { _battleInit.StartBattle(); }) .AddTo(_subscriptions); _generatorDungeon.Seed.SubscribeToText(SeedInputField).AddTo(_subscriptions); var setRandomSeedCommand = new AsyncReactiveCommand(); setRandomSeedCommand.Subscribe(_ => { _generatorDungeon.SetRandomSeed(); return(Observable.Timer(TimeSpan.FromSeconds(1)).AsUnitObservable()); }).AddTo(_subscriptions); setRandomSeedCommand.BindTo(RandomSeedButton).AddTo(_subscriptions); GenerateMapButton.OnPointerClickAsObservable().Subscribe(_ => { _generatorDungeon.BuildDungeon(); }) .AddTo(_subscriptions); }