Example #1
0
        internal void SubmitToGameState()
        {
            if (GameState.CanMeldLayOff(_meldOwner) &&
                AssociatedWithGameStateAlready == false &&
                _submittingMeld == false)
            {
                if (_temporaryCardsList.Count >= 3)
                {
                    _submittingMeld = true;
                    GameState.Meld(_meldOwner, _temporaryCardsList);
                    AssociateWithMeldInGameState(GameState.GetMelds(_meldOwner).Count - 1);
                    _submittingMeld = false;
                }
                else
                {
                    var playerCardsShape = UIServices.GetPlayerCardsShape(_meldOwner);
                    foreach (var c in _temporaryCardsList.ToArray())
                    {
                        playerCardsShape.CancelDrag(c);
                        _temporaryCardsList.Remove(c);
                    }

                    RenderContents();
                }
            }
        }