Пример #1
0
    protected virtual void OnButtonNewGameClicked(object sender, System.EventArgs e)
    {
        var newGameDialog = new DialogNewGame();

        if (newGameDialog.Run() == (int)ResponseType.Ok)
        {
            var gameInfo = newGameDialog.GetGameInfo();

            if (gameInfo != null)
            {
                var iter = gameStore.AppendValues(false, gameInfo.GameName,
                                                  gameInfo.GameDescription, gameInfo);

                treeViewGames.Selection.SelectIter(iter);
            }
        }

        newGameDialog.Destroy();
    }
Пример #2
0
        /// <summary>
        /// Startings the game handle.
        /// </summary>
        /// <returns>The game handle.</returns>
        IEnumerator <float> StartingGameHandle()
        {
            // TODO: waiting time.
            yield return(Timing.WaitForSeconds(0.5f));

            // TODO: showing the dialog.

            Debug.Log("KLONDIKE StartingGameHandle " + GameManager.Instance.GetModeGame());
            if (GameManager.Instance.GetModeGame() == Enums.ModeGame.None)
            {
                DialogSystem.Instance.ShowDialogNewGame();
            }
            else
            {
                DialogNewGame.updateMode(GameManager.Instance.GetModeGame());
            }



            // TODO: waiting.
            while (GameManager.Instance.GetStateGame() != Enums.StateGame.Start)
            {
                yield return(0f);
            }

            Debug.Log("KLONDIKE StartingGameHandle after while");
            // TODO: Init the functions
            Init();

            // TODO: Count the number cards will be used.
            Contains.TotalCardsAreUsing = cardsGet.Count;

            // TODO: Create the cards will be return to pools.
            var paramIn = new List <CardBehaviour> (cardsGet);

            // TODO: Clear all the cards to prepare add the new cards.
            cardsGet.Clear();

            // TODO: Get the new cards.
            cardsGet.AddRange(Helper.SortRandom(paramIn));

            yield return(0f);
        }
Пример #3
0
    /// <summary>
    /// Shows the dialog new game.
    /// </summary>
    public void ShowDialogNewGame()
    {
        Debug.Log("ShowDialogNewGame");
        // TODO: Get the dialog.
        var dialog = GetTheDialog <DialogNewGame> (prefabDialogNewGame, dialogNewGame);

        // TODO: Check if this null.
        if (object.ReferenceEquals(dialog, null))
        {
            // TODO: Break the functions.
            return;
        }

        // TODO: set the default dialog.
        dialogNewGame = dialog;

        // TODO: Show the dialog.
        DoShow(dialog);
    }