Example #1
0
        private void OnStartButtonClicked()
        {
            var players = RowRegistry.GetValidatedPlayers();

            if (players == null || players.Count < 2)
            {
                ModalDialog.Show("<color=red>Error!</color>\nNot all values are filled.");
                return;
            }
            Info.Players = players;
            SceneLoader.LoadScene("GameBoard", LoadSceneMode.Single, container =>
            {
                container.BindInstance(Info).WhenInjectedInto <GameBoardInstaller>();
            });
        }
        public static void ShowNotification(GameInfo info)
        {
            info.GameState = GameStates.Paused;
            var details = new ModalDialogDetails
            {
                DialogMessage = "Next player: " + info.ActivePlayer.Name,
                Button1       = new ModalDialogButtonDetails
                {
                    Title   = "OK",
                    Handler = () => info.GameState = GameStates.Started
                }
            };

            ModalDialog.Show(details);
        }
Example #3
0
        private void StartGame()
        {
            var details = new ModalDialogDetails
            {
                DialogMessage = "Board is ready. Press \"OK\" to continue.",
                Button1       = new ModalDialogButtonDetails
                {
                    Title   = "OK",
                    Handler = () =>
                    {
                        Info.HistoryItems = null;
                        Info.GameState    = GameStates.Started;
                        ActivePlayerHandler.ShowNotification(Info);
                    }
                }
            };

            ModalDialog.Show(details);
        }
Example #4
0
 public void Construct(ModalDialog presenter)
 {
     presenter.SetView(this);
 }