///<summary>
        /// This is used during collision search between arrangements,
        /// since every arragnment is created with duplicate tiles.
        ///</summary>
        public bool HasDuplicateTile(GameTile p_gameTile)
        {
            for (int i = 0; i < ArrangedGroups.Count; i++)
            {
                if (ArrangedGroups[i].HasDuplicate(p_gameTile))
                {
                    return(true);
                }
            }

            if (RemainderGroup != null && RemainderGroup.HasDuplicate(p_gameTile))
            {
                return(true);
            }

            return(false);
        }
Beispiel #2
0
        ///<summary>
        /// Grouping method that works on o(n^2) since GameTileGroup is iterated for every GameTile inside the group
        ///</summary>
        protected GameTileGroup GroupMethod(GameTile p_selectedTile, GameTileGroup p_gameTileGroup)
        {
            GameTileGroup result = new GameTileGroup();

            result.AddGameTile(p_selectedTile);

            for (int i = 0; i < p_gameTileGroup.GameTileCount; i++)
            {
                if (p_gameTileGroup[i].CompareColor(p_selectedTile) && p_gameTileGroup[i].IsNextOf(p_selectedTile))
                {
                    p_selectedTile = p_gameTileGroup[i];
                    result.AddGameTile(p_selectedTile);
                    i = -1;
                }
            }

            return(result);
        }
Beispiel #3
0
 public void AddTile(GameTile p_gameTile)
 {
     EveryTile.AddGameTile(p_gameTile);
 }
 public GameTileArranger(GameTile p_okeyTile)
 {
     _okeyTile = p_okeyTile;
 }
 ///<summary>
 /// For some reason sorting algorithm leaves some ungroups single tiles,
 /// that's a bug, this is a brute fix
 ///</summary>
 public void AddTile(GameTile p_gameTile)
 {
     RemainderGroup.AddGameTile(p_gameTile);
 }
Beispiel #6
0
 public GameTileSameNumberArranger(GameTile p_okeyTile) : base(p_okeyTile)
 {
 }
Beispiel #7
0
 public GameTileSameColorArranger(GameTile p_okeyTile) : base(p_okeyTile)
 {
 }
 public GameTileSmartArranger(GameTile p_okeyTile) : base(p_okeyTile)
 {
 }