Esempio n. 1
0
 public Game()
 {
     this.GameStartup = new GameStartup();
     this.GameEnd     = new GameEnd();
     this.CDisp       = new ControllerDisplay();
     this.N           = new Notification();
 }
Esempio n. 2
0
 public GameEnd()
 {
     this.CDisp = new ControllerDisplay();
 }
Esempio n. 3
0
 public About()
 {
     this.CDisp = new ControllerDisplay();
     this.N     = new Notification();
 }
Esempio n. 4
0
        public MainViewModel(Window main_window, Panel panel_parent, MediaElement media_display, Panel controller_icon_parent, Panel root_grid)
        {
            GameDescription = new ReactiveProperty <string>().AddTo(this.Disposable);

            mediaDisplay      = new MediaDisplay(media_display);
            controllerDisplay = new ControllerDisplay(controller_icon_parent);

            //ここでパネル生成できなかった場合各種プロセスは動作させない
            try {
                new PanelCreator(new GameInfoJsonReader()).Launch(panel_parent);
            } catch (Exception e) {
                Logger.Inst.Log("I wanna stop my process bc GamePanels was didn't create.", LogLevel.Warning);
                return;
            }

            var panel_controller = new PanelController(panel_parent);
            var customer_timer   = new CustomerTimer();
            var mask_control     = new MaskControl(root_grid);

            main_window.Closed += (e, sender) => {
                customer_timer.Dispose();
            };
            //キー入力はViewにバインドされているので動作の定義だけする
            //エンター
            EnterKeyCommand.Subscribe(n => gameLaunchStream.OnNext(Unit.Default));
            //上下移動
            ListUpCommand.Subscribe(n => panelSlideStream.OnNext(1));
            ListDownCommand.Subscribe(n => panelSlideStream.OnNext(-1));
            //スキップ入力
            ListSkipUpCommand.Subscribe(n => panelSkipStream.OnNext(-1));
            ListSkipDownCommand.Subscribe(n => panelSkipStream.OnNext(1));
            //リセット
            TimerResetCommand.Subscribe(n => {
                customer_timer.Stop();
                panel_controller.Shuffle();
            });

            //リスト移動入力の定義
            panelSlideStream
            .Merge(GamePadObserver.Inst.InVerticalStickEvent.Sample(TimeSpan.FromMilliseconds(200)))
            .Where(n => !GameProcessControl.Inst.IsRunning)
            .Where(n => n != 0)
            .Subscribe(n => {
                if (n == 1)
                {
                    panel_controller.MoveUp();
                }
                else if (n == -1)
                {
                    panel_controller.MoveDown();
                }
            });

            //スキップ入力の定義
            panelSkipStream
            .Merge(GamePadObserver.Inst.InHorizontalStickEvent.Sample(TimeSpan.FromMilliseconds(150)))
            .Where(n => !GameProcessControl.Inst.IsRunning)
            .Where(n => n != 0)
            .Subscribe(n => { panel_controller.Skip(n); });

            //ゲーム起動入力の定義
            gameLaunchStream
            .Merge(GamePadObserver.Inst.OnEnterKeyDown.Where(n => n).Select(n => Unit.Default))
            .Merge(panel_controller.OnPanelClick)
            .Subscribe(n => {
                GameProcessControl.Inst.GameLaunch(panel_controller.GetCurrentPanelsInfo.MyGameInfo.BinPath, panel_controller.GetCurrentPanelsInfo.MyGameInfo.GameId.ToString());
            });

            //ゲーム起動時のイベント
            GameProcessControl.Inst.OnGameStart.Subscribe(n => {
                customer_timer.StartRequest();
                mask_control.Run();
                mediaDisplay.Pause();
            });

            //ゲーム終了時のイベント
            GameProcessControl.Inst.OnGameEnd.Subscribe(n => {
                mask_control.Remove();
                mediaDisplay.ReStart();
            });

            //一応起動時もシャッフル

            //PanelControllerの選択切り替えイベントを受け取る
            panel_controller.OnChangeSelected.Subscribe(ChangeSelectedDisplay);
            panel_controller.Shuffle();
        }
Esempio n. 5
0
 public Program()
 {
     this.CDisp = new ControllerDisplay();
     MM         = new MainMenu();
 }
Esempio n. 6
0
 public MainMenu()
 {
     this.CDisp = new ControllerDisplay();
 }
Esempio n. 7
0
 public Travel()
 {
     this.CDisp = new ControllerDisplay();
 }
Esempio n. 8
0
 public GameStartup()
 {
     CDisp = new ControllerDisplay();
     N     = new Notification();
 }