Exemple #1
0
        private void AutoAddComboCombination(CombinationData _combination)
        {
            List <CombinationData> _combo = new List <CombinationData>();

            _combo.Add(_combination);
            int lenghAll = allCombinations.Count;

            if (lenghAll < 1)
            {
                return;
            }
            for (int all = 0; all < lenghAll; all++)
            {
                if (!_combo.Contains(allCombinations[all]))
                {
                    for (int current = 0; current < _combo.Count; current++)
                    {
                        int lenghCard = _combo[current].cards.Length;
                        for (int card = 0; card < lenghCard; card++)
                        {
                            if (allCombinations[all].cards.Contains(_combo[current].cards[card]))
                            {
                                HexagonalCell _cell = HexagonalGrid.Instance.GetCell(_combo[current].cards[card].Info.myX, _combo[current].cards[card].Info.myY);
                                BonusManager.Instance.CreateBonus(_cell, allCombinations[all]);
                                _combo.Add(allCombinations[all]);
                                card    = lenghCard;
                                current = _combo.Count;
                                all     = 0;
                            }
                        }
                    }
                }
            }
            AddScores(_combo.ToArray());
        }
Exemple #2
0
        private void AddCombinations(Card[] _cards, eCombination _Ecombo)
        {
            CombinationData _comb = new CombinationData();

            _comb.cards = _cards;
            _comb.currentCombination = _Ecombo;
            allCombinations.Add(_comb);
            FlashingCellsAnimation(_cards, _Ecombo);
        }
Exemple #3
0
        private void ClearCellFromCard(float maxScore, CombinationData _combinations)
        {
            int   lenght      = _combinations.cards.Length;
            float scoreOnCell = maxScore / lenght;

            for (int i = 0; i < lenght; i++)
            {
                HexagonalCell _cell = HexagonalGrid.Instance.GetCell(_combinations.cards[i].Info.myX, _combinations.cards[i].Info.myY);
                _cell.ClearFromCard((int)scoreOnCell, _combinations.currentCombination);
            }
        }
Exemple #4
0
 private void CheckClosedCard(CombinationData _combinations)
 {
     for (int i = 0; i < _combinations.cards.Length; i++)
     {
         HexagonalCell[] closedCell = HexagonalGrid.Instance.GetNearIsClosed(_combinations.cards[i].Info.myX, _combinations.cards[i].Info.myY);
         for (int _card = 0; _card < closedCell.Length; _card++)
         {
             closedCell[_card].GetCard().SetIsClosed(false);
         }
     }
 }
Exemple #5
0
        private void FlashingCoroutineInCell(CombinationData _combination)
        {
            int lengCard = _combination.cards.Length;

            for (int y = 0; y < lengCard; y++)
            {
                eCombination  _comb = _combination.currentCombination;
                HexagonalCell _cell = HexagonalGrid.Instance.GetCell(_combination.cards[y].Info.myX, _combination.cards[y].Info.myY);
                _cell.FlashingCoroutine(_comb);
            }
        }
Exemple #6
0
        private int GetMaxNumCard(CombinationData _combinations)
        {
            int maxNumCard = 0;
            int lenght     = _combinations.cards.Length;

            for (int i = 0; i < lenght; i++)
            {
                if (maxNumCard < _combinations.cards[i].Info.myNumCard)
                {
                    maxNumCard = _combinations.cards[i].Info.myNumCard;
                }
            }
            return(maxNumCard);
        }