Esempio n. 1
0
    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);
        }
    }
Esempio n. 2
0
    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;
    }
Esempio n. 3
0
        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();
            }
        }
Esempio n. 4
0
    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);
            }
        }
    }
Esempio n. 5
0
 public void HideCard()
 {
     PlayedCardsController.RecallCard();
     gameObject.SetActive(false);
 }
Esempio n. 6
0
 public override void PlayCard(Common.Card cardToPlay)
 {
     PlayedCardsController.PlayCard(cardToPlay, UIPlayer.GetRelativePlayerSeat(GetPlayersSeat()), this);
 }
Esempio n. 7
0
 public override void HandEnded(Player winner)
 {
     PlayedCardsController.ResetHand(winner.GetPlayersSeat(), this, winner);
 }