Exemple #1
0
 // This handler check to see if we have the card index
 // Does contain the key, destroy the object
 // Remove the card from the deck
 // Destroy take the game object and remove the scene
 private void Deck_CardRemoved(object sender, CardRemoved e)
 {
     if (fetchedCards.ContainsKey(e.CIndex))
     {
         Destroy(fetchedCards[e.CIndex]);
         fetchedCards.Remove(e.CIndex);
     }
 }
 private void OnCardRemoved()
 {
     lock (_syncLocker)
     {
         _isCardHere = false;
         CardRemoved?.Invoke(this, EventArgs.Empty);
     }
 }
Exemple #3
0
    public int Pop()
    {
        int temp = cards[0];

        cards.RemoveAt(0);

        CardRemoved?.Invoke(this, new CardEventArgs(temp));

        return(temp);
    }
        private void Monitor_CardRemoved(object sender, CardStatusEventArgs args)
        {
            if (blockCardEvents > 0)
            {
                return;
            }

            StatusMessage?.Invoke("Tag removed on " + args.ReaderName);

            CardRemoved?.Invoke(args.ReaderName);
        }
Exemple #5
0
        public async Task HandleAsync(CardRemoved @event)
        {
            if (!await _cardsStore.ExistsAsync(@event.CardId.Value))
            {
                return;
            }

            var card = await _cardsStore.GetAsync(@event.CardId.Value);

            card.Remove();
            card.ChangeTimestamp(_clock.Now.DateTime);

            await _cardsStore.UpdateAsync(card);

            _logger.LogDebug($"Card {@event.UserId} removed.");
        }
Exemple #6
0
    public void Remove(int index)
    {
        if (IsEmpty)
        {
            Debug.LogWarning("Deck: Nothing to remove - deck is empty!");
            return;
        }
        else if (!IndexIsWithinRange(index))
        {
            Debug.LogWarning("Deck: Nothing  to remove - index out of range");
            return;
        }

        T removedItem = _cards[index];

        _cards.RemoveAt(index);

        CardRemoved?.Invoke(removedItem);

        if (_cards.Count == 0)
        {
            Emptied?.Invoke();
        }
    }
Exemple #7
0
 public void When(CardRemoved cardRemoved)
 {
     Deleted = cardRemoved.Deleted;
 }
 protected virtual void OnCardRemoved()
 {
     CardRemoved.Invoke(this, EventArgs.Empty);
 }
Exemple #9
0
 private void When(CardRemoved @event)
 {
     _isRemoved = true;
 }
 private void OnCardRemoved(object sender, EventArgs e) => CardRemoved?.Invoke(this, e);