public override void PlayCard(Common.Card cardToPlay) { Card playedCard = null; if (uiDeck.playedCard != null) { playedCard = uiDeck.playedCard.GetCard(); } if (playedCard == null || playedCard.GetCardType() != cardToPlay.GetCardType() || playedCard.GetCardValue() != cardToPlay.GetCardValue()) { CardSlot[] cardSlots = uiDeck.GetCardSlots(); int i = 0; bool found = false; while (!found) { if (cardSlots[i].Card.GetCardType() == cardToPlay.GetCardType() && cardSlots[i].Card.GetCardValue() == cardToPlay.GetCardValue()) { uiDeck.playedCard = cardSlots[i].CardObject.transform.GetComponent <UICard>(); PlayedCardsController.PlaceCard(cardSlots[i].CardObject.transform); UserInteraction.InputActive = false; // FINALLY ACTUALLY PLAY THE CARD base.PlayCard(cardToPlay); found = true; } i++; } } else { base.PlayCard(cardToPlay); } }
public void ResetPosition(bool recallCard) { cardSprite.sortingOrder = layerOrder; transform.parent = GameObject.FindGameObjectWithTag("DECK").transform; this.transform.localPosition = initialPosition; this.transform.localRotation = initialRotation; initialPosition = Vector3.zero; if (recallCard) { PlayedCardsController.RecallCard(); } released = false; }
public void EndHand() { var awaitingWinner = PlayedCardsController.awaitingWinner; roundScores[awaitingWinner.GetPlayersSeat()].IncrementGot(); handCount++; if (handCount > 13) { PlayedCardsController.EndRound(roundScores, bidWinningPlayer.GetPlayersSeat()); } else { UIHand nextHand = new UIHand(awaitingWinner, trumpType, this); nextHand.StartHand(); } }
public void Release() { GameObject scriptWrapper = GameObject.FindGameObjectWithTag("SCRIPTWRAPPER"); if (scriptWrapper != null && !released) { released = true; MonoPlayer player = scriptWrapper.GetComponent <MonoPlayer>(); MonoNetworkPlayer networkPlayer = scriptWrapper.GetComponent <MonoNetworkPlayer>(); if (transform.position.y > player.splitter.transform.position.y) { // CARD PLAYED this.transform.position = new Vector3(transform.position.x, transform.position.y, 1f); player.playerDeck.playedCard = this; PlayedCardsController.PlaceCard(transform); UserInteraction.InputActive = false; // FINALLY ACTUALLY PLAY THE CARD if (Properties.ActiveGameType == GameType.SinglePlayer) { player.getInternalPlayer().PlayCard(this.card); } else { networkPlayer.GetInternalPlayer().PlayCard(this.card); } released = false; } else { ResetPosition(false); } } }
public void HideCard() { PlayedCardsController.RecallCard(); gameObject.SetActive(false); }
public override void PlayCard(Common.Card cardToPlay) { PlayedCardsController.PlayCard(cardToPlay, UIPlayer.GetRelativePlayerSeat(GetPlayersSeat()), this); }
public override void HandEnded(Player winner) { PlayedCardsController.ResetHand(winner.GetPlayersSeat(), this, winner); }