/// <summary> /// Return the card to original deck /// </summary> private void ReleaseDraggedCard(bool _giveBackToOriginalDeck) { if (draggedCard == null) { return; } if (_giveBackToOriginalDeck) { draggedCardOriginalDeck.AddTopCard(draggedCard); //Return the card to original Deck } else if (draggedCardOriginalDeck.deckType == DeckController.DeckType.Column) { if (draggedCardOriginalDeck.IsTopCardFrontSide) //Add the card to the new deck and flip the top { draggedCardOriginalDeck.DrawCard(true, false); //card of the original deck if it wasn't already flipped (front side) } else { AssignPoints(5); //Special case: assign 5 points if a card in column is reveald draggedCardOriginalDeck.DrawCard(true, true); } } else if (draggedCardOriginalDeck.deckType == DeckController.DeckType.DrawnCards) { draggedCardOriginalDeck.DrawCard(true, false); //Never flip the drawn cards (they are already fron side) draggedCardOriginalDeck.OrderCards(); //Always update their displacement } draggedCard = null; isDragging = false; }
/// <summary> /// Reation to button-like input /// </summary> /// <param name="_deck"></param> public void OnInputDonwAndUpRecived(DeckController _deck) { if (IsPaused) { return; } if (_deck.deckType == DeckController.DeckType.Main) { int amount = DrawThreeRule ? 3 : 1; for (int i = 0; i < amount; i++) { _deck.DrawCard(false, true); _deck.TransferTopCard(DeckDrawnCards); } //It stores a move of "draw" by the main deck. Not sure if requested //GameManager.I.MoveCtrl.RecordMove(0, DeckDrawnCards.GetTopCard(), _deck, DeckDrawnCards); } //Previous system where player has to flip the card by himself //if(_deck.deckType == DeckController.DeckType.Column) //{ // if(!_deck.IsTopCardFrontSide) // _deck.DrawCard(true, true); //} }
/// <summary> /// Give starting cards /// One front faced and the others down faced /// </summary> /// <param name="_dCtrl"></param> /// <param name="_amount"></param> public void GiveStartingCards(DeckController _dCtrl, short _amount) { while (_amount > 1) { DeckMain.DrawCard(false, false); DeckMain.TransferTopCard(_dCtrl); _amount--; } if (_amount == 1) { DeckMain.DrawCard(false, true); DeckMain.TransferTopCard(_dCtrl); return; } return; }