示例#1
0
        //***********************************************************************
        //*************************** Public Methods ****************************
        //***********************************************************************

        //Rebuilds the potential meld list from zero
        public void RebuildMeldList()
        {
            Melds.Clear();
            //All closed tiles are loose until proven otherwise
            LooseTiles = new SortedTileCollection(hand.Tiles.Closed.GetTileList(), accessKey);
            //Add all the open melds
            int i = 0;

            for (i = 0; i < hand.OpenMelds.Count; i++)
            {
                AddMeld(hand.OpenMelds[i].ConvertToPotentialMeld());
            }
            //Handle all closed tiles
            List <TileID>        closed = hand.Tiles.Closed.GetTileIDList(accessKey);
            CheckForwardResponse info;

            i = 0;
            while (i < closed.Count)
            {
                info = CheckForward(i);
                if (info.count > 0)
                {
                    LooseTiles.Remove(hand.Tiles.Closed[i], accessKey);
                }
                i++;
            }
        }
示例#2
0
 //Constructor
 public OpenMeld(MeldType type, List <Tile> tiles, int playerNumber)
 {
     Type         = type;
     _tiles       = new SortedTileCollection(tiles);
     PlayerNumber = playerNumber;
     for (int i = 0; i < Tiles.Count; i++)
     {
         Tiles[i].InOpenMeld = true;
     }
 }