public List <Tile> GetAllTiles() { var output = TilesLeft.ToList(); foreach (var meld in Melds) { output.AddRange(meld.Tiles); } return(output); }
public void CreateMeld(Meld meld) { Melds.Add(meld); foreach (var tile in meld.Tiles) { var found = TilesLeft.FirstOrDefault(q => q.Rank == tile.Rank && q.Suit == tile.Suit); if (found != null) { TilesLeft.Remove(found); } else { throw new Exception("Could not create meld"); } } }