Esempio n. 1
0
        public void DiscardTile(string tile)
        {
            var singleTile = new int[34];

            TileOperation.TileStr2TileArray(tile, out singleTile);
            TileOperation.MergeTileArr(ref tiles, singleTile, false);
        }
Esempio n. 2
0
        private int calculateShanten()
        {
            calculateResult.Clear();
            int shantenNow = TileOperation.CalculateShanten(tiles);

            for (int i = 0; i < 34; i++)
            {
                if (tiles[i] == 0)
                {
                    continue;
                }
                tiles[i]--;
                for (int j = 0; j < 34; j++)
                {
                    if (i == j)
                    {
                        continue;
                    }

                    tiles[j]++;
                    int shantenTemp = TileOperation.CalculateShanten(tiles);
                    if (shantenTemp < shantenNow)
                    {
                        if (calculateResult[i] == null)
                        {
                            calculateResult[i] = new List <int>();
                        }
                        calculateResult[i].Add(j);
                    }
                    tiles[j]--;
                }
                tiles[i]++;
            }

            return(0);
        }
Esempio n. 3
0
 public PlayerModel(string tileStr)
 {
     TileOperation.TileStr2TileArray(tileStr, out tiles);
 }