コード例 #1
0
        /**
         * Calculates the score penalty based on the floor line and returns all of the tiles that were placed there
         *
         * @return a TileCollection representing all the tiles discarded from the floor line
         */
        private TileCollection scoreFloor()
        {
            int numTiles = floorLine.Count;

            if (numTiles > 7)
            {
                numTiles = 7;
            }
            score += floorLineScores[numTiles];
            if (score < 0)
            {
                score = 0;
            }
            TileCollection discard = new TileCollection(floorLine);

            floorLine.Clear();
            return(discard);
        }
コード例 #2
0
ファイル: Game.cs プロジェクト: Jsnhlbr5/Azul-C-Sharp
 private void resetCenter()
 {
     for (int i = 0; i < factories.Length; ++i)
     {
         factories[i] = bag.drawTiles(4);
         if (factories[i].Count < 4)
         {
             if (!boxLid.Empty)
             {
                 bag.AddRange(boxLid);
                 boxLid.Clear();
                 factories[i].AddRange(bag.drawTiles(4 - factories[i].Count));
             }
             else
             {
                 // No more tiles to draw, remaining factories will be empty.
                 break;
             }
         }
     }
     centerArea.Add(Color.WHITE);
     UpdateTiles();
 }