Example #1
0
 private void CheckGameCondition()
 {
     if (m_TopCards.Count >= 52)
     {
         m_GameResult = Solitaire.GameResult.Win;
         Utilities.Instance.DispatchEvent(Solitaire.Event.ShowPopup, "game_result", (int)m_GameResult);
         Utilities.Instance.DispatchEvent(Solitaire.Event.PlayEffect, "firework", "");
     }
     else
     {
         if (m_MoveRemain <= 0)
         {
             m_GameResult = Solitaire.GameResult.Lose;
             Utilities.Instance.DispatchEvent(Solitaire.Event.ShowPopup, "game_result", (int)m_GameResult);
         }
     }
 }
Example #2
0
    private void Initialized()
    {
        m_CommandsProcessor = new CommandsProcessor();
        m_DeckCards         = m_GameData.deckCards = new List <CardElement>();
        m_BottomCards       = m_GameData.bottomCards = new List <CardElement>();
        m_TopCards          = m_GameData.topCards = new List <CardElement>();
        m_CurrentSelected   = null;
        m_GameResult        = Solitaire.GameResult.Still;
        m_PrevClickedTime   = 0.0f;
        GenerateDeck();
        StartCoroutine(DealCards());

        m_MoveRemain  = GameSetting.Instance.difficulty.moveAllowed;
        m_IsGameStart = true;
        m_ElapsedTime = new TimeSpan();
        StartCoroutine(UpdateTime());
    }