Esempio n. 1
0
    private void Awake()
    {
        image = GameObject.FindGameObjectWithTag("Image").GetComponent <Image>();

        if (image == null)
        {
            Debug.LogError("Image not found");
        }

        Transform answers = GameObject.Find("Answers").transform;

        for (int i = 0; i < answers.childCount; i++)
        {
            buttonAnswers[i] = answers.GetChild(i).GetComponent <ButtonAnswer>();
        }

        canvasGroup = GameObject.FindGameObjectWithTag("Fade").GetComponent <CanvasGroup>();

        if (canvasGroup == null)
        {
            Debug.Log("CanvasGroup not found");
        }

        removeCardButton = FindObjectOfType <RemoveCard>();

        sourceFSX = GameObject.FindGameObjectWithTag("FSX").GetComponent <AudioSource>();

        IncreasePhase();
    }
Esempio n. 2
0
        public void Given_deck_of_5_return_deck_of_4()
        {
            //Given I have a deck list with a length of 5
            List <Card> deck = new List <Card>();

            deck.Add(new Card {
                Suit = Suit.Clubs, Value = "2"
            });
            deck.Add(new Card {
                Suit = Suit.Clubs, Value = "2"
            });
            deck.Add(new Card {
                Suit = Suit.Clubs, Value = "2"
            });
            deck.Add(new Card {
                Suit = Suit.Clubs, Value = "2"
            });
            deck.Add(new Card {
                Suit = Suit.Clubs, Value = "2"
            });
            //When I call the removeCardFromDeck method
            IRemoveCard remove = new RemoveCard();
            List <Card> final  = remove.RemoveCardFromDeck(deck);

            //Then I will get back a deck list with a length of 4
            Assert.AreEqual(4, final.Count);
        }
Esempio n. 3
0
        public async Task <IActionResult> Remove([FromRoute] Guid cardId)
        {
            var id      = new CardId(cardId);
            var command = new RemoveCard(id);

            await _lifetimeService.RemoveAsync(command);

            return(Ok());
        }
    public int Pop()
    {
        int temp = deck[0];

        deck.RemoveAt(0);

        RemoveCard?.Invoke(this, new CardEventArgs(temp));
        return(temp);
    }
Esempio n. 5
0
        public void Given_deck_of_0_return_deck_of_0()
        {
            //Given I have a deck list with a length of 0
            List <Card> deck = new List <Card>();
            //When I call the removeCardFromDeck method
            IRemoveCard remove = new RemoveCard();
            List <Card> final  = remove.RemoveCardFromDeck(deck);

            //Then I will get back a deck list with a length of 0
            Assert.AreEqual(0, final.Count);
        }
Esempio n. 6
0
        public void Given_I_have_a_deck_size_of_0_the_new_count_should_still_be_0()
        {
            // Given I have a deck with a list size of 0
            // And I want to draw a card from the deck
            List <Card> cards = new List <Card>();

            // When I call the Remove Cardmethod
            IRemoveCard removeCard  = new RemoveCard();
            List <Card> newCardList = removeCard.RemoveCardFromDeck(cards);

            // Then I expected the card list size is still 0.
            Assert.AreEqual(0, newCardList.Count);
        }
Esempio n. 7
0
        public async Task RemoveAsync(RemoveCard command)
        {
            var card = (await _repository.GetAsync(command.CardId)).SingleOrDefault();

            if (card == null || card.IsRemoved)
            {
                return;
            }

            card.Remove();

            await _repository.SaveAsync(card);

            _logger.LogDebug($"Card removed ({command.CardId}).");
        }
Esempio n. 8
0
        public void Given_I_have_a_deck_size_of_2_the_new_count_should_be_1()
        {
            // Given I have a deck with a list size of 2
            // And I want to draw a card from the deck
            List <Card> cards = new List <Card>();

            cards.Add(new Card());
            cards.Add(new Card());

            // When I call the Remove Cardmethod
            IRemoveCard removeCard  = new RemoveCard();
            List <Card> newCardList = removeCard.RemoveCardFromDeck(cards);

            // Then I expected the card list size is reduced to 1.
            Assert.AreEqual(1, newCardList.Count);
        }
Esempio n. 9
0
    private void Awake()
    {
        #region References

        buttonScoreText           = GameObject.Find("ButtonScore").GetComponent <Text>();
        startPositionOfButtonText = buttonScoreText.transform.position;

        gameManager = FindObjectOfType <GameManager>();

        sbangButton = FindObjectOfType <RemoveCard>();

        currentScoreText = FindObjectOfType <CurrentScore>();
        multiplierText   = FindObjectOfType <Multiplier>();
        timeBarText      = FindObjectOfType <TimeBar>();

        totalScoreText = FindObjectOfType <TotalScore>();

        #endregion
    }
Esempio n. 10
0
 /// <inheritdoc cref="RemoveCardAsync(Commands.RemoveCard, CancellationToken)"/>
 public RemoveCardResponse RemoveCard(RemoveCard removeCard)
 => Post <RemoveCard, RemoveCardResponse>(removeCard);
Esempio n. 11
0
 /// <summary>
 /// Метод удаляет привязанную карту покупателя
 /// </summary>
 /// <param name="removeCard"></param>
 /// <param name="cancellationToken"></param>
 /// <returns></returns>
 public Task <RemoveCardResponse> RemoveCardAsync(RemoveCard removeCard, CancellationToken cancellationToken)
 => PostAsync <RemoveCard, RemoveCardResponse>(removeCard, cancellationToken);