Пример #1
0
 public SpecialTileCreateSignal(MatchInfo match)
 {
     this.match = match;
 }
Пример #2
0
        void FindMatch(int row, int col, MatchInfo findinfo, FindDirection dir)
        {
            int             num = 0;
            compareTile     compareTile1;
            compareTile     compareTile2;
            getNeighborTile getTile1;
            getNeighborTile getTile2;

            if (dir == FindDirection.Horizon)
            {
                num          = _gamepanel.NumCol - 1;
                compareTile1 = _gamepanel.IsSameLeft;
                compareTile2 = _gamepanel.IsSameRight;
                getTile1     = _gamepanel.GetLeftTile;
                getTile2     = _gamepanel.GetRightTile;
            }
            else
            {
                num          = _gamepanel.NumRow - 1;
                compareTile1 = _gamepanel.IsSameUp;
                compareTile2 = _gamepanel.IsSameDown;
                getTile1     = _gamepanel.GetUpTile;
                getTile2     = _gamepanel.GetDownTile;
            }

            List <Tile> matchCandidates = new List <Tile>(); // 매치 확인을 위해 임시로 저장
            bool        bStopLeft       = false;
            bool        bStopRight      = false;

            for (int i = 0; i < num; i++)
            {
                if (!bStopLeft && compareTile1(row, col, i))
                {
                    matchCandidates.Add(getTile1(row, col, i));
                }
                else if (bStopRight)
                {
                    break;
                }
                else
                {
                    bStopLeft = true;
                }

                if (!bStopRight && compareTile2(row, col, i))
                {
                    matchCandidates.Add(getTile2(row, col, i));
                }
                else if (bStopLeft)
                {
                    break;
                }
                else
                {
                    bStopRight = true;
                }
            }

            if (matchCandidates.Count >= 2)
            {
                makeMatch(findinfo, dir, matchCandidates);
            }
            matchCandidates.Clear();
        }
Пример #3
0
 public EndTileAttractionSignal(MatchInfo matchInfo)
 {
     this.matchInfo = matchInfo;
     match          = matchInfo.matchType;
 }
Пример #4
0
 public void AddTilePosition(MatchInfo info)
 {
     matchlist.AddRange(info.matchlist);
 }