示例#1
0
        public Decision Dequeue()
        {
            var next = _queue[0];

            _queue.Remove(next);
            return(next);
        }
示例#2
0
文件: Card.cs 项目: longde123/grove
        public void Detach(Card card)
        {
            _attachments.Remove(card);
            card.AttachedTo = null;

            Publish(new AttachmentDetachedEvent(attachment: card, attachedTo: this));
        }
示例#3
0
        private void RemoveModifier(IModifier modifier)
        {
            _doNotUpdate.Value = modifier;

            _modifiers.Remove(modifier);
            modifier.Owner.RemoveModifier(modifier);
        }
示例#4
0
文件: Stack.cs 项目: longde123/grove
        private void Remove(Effect effect)
        {
            _effects.Remove(effect);
            EffectRemoved(this, new StackChangedEventArgs(effect));

            LogFile.Debug("Effect removed from stack: {0}. (count: {1})", effect, _effects.Count);
        }
示例#5
0
        public void Consume(IManaAmount amount, ManaUsage usage)
        {
            var allocated = TryToAllocateAmount(amount, usage);

            Asrt.True(allocated != null, "Not enough mana available.");

            var sources = GetSourcesToActivate(allocated);

            foreach (var source in sources)
            {
                lock (_manaPoolCountLock)
                {
                    foreach (var unit in source.GetUnits())
                    {
                        _manaPool.Add(unit);
                    }
                }

                source.PayActivationCost();
            }

            lock (_manaPoolCountLock)
            {
                foreach (var unit in allocated)
                {
                    _manaPool.Remove(unit);
                }
            }

            foreach (var unit in allocated.Where(x => !x.HasSource))
            {
                RemovePermanently(unit);
            }
        }
示例#6
0
        protected virtual void Remove(Card card)
        {
            var removed = _cards.Remove(card);

            Asrt.True(removed, "Card was not found in zone.");

            CardRemoved(this, new ZoneChangedEventArgs(card));
        }
示例#7
0
        private void RemovePermanently(ManaUnit unit)
        {
            foreach (var colorIndex in unit.Color.Indices)
            {
                _groups[colorIndex].Remove(unit);
            }

            _units.Remove(unit);
        }
示例#8
0
        public void Remove(Counter counter)
        {
            if (_counters.Remove(counter))
            {
                counter.Remove();
            }

            Publish(new CounterRemovedEvent(counter, _owningCard));
        }
示例#9
0
        public void RemoveModifier(ICardModifier modifier)
        {
            _modifiers.Remove(modifier);
            modifier.Dispose();

            if (IsPermanent)
            {
                Publish(new PermanentModifiedEvent(this, modifier));
            }
        }
示例#10
0
        public void Detach(Card card)
        {
            _attachments.Remove(card);
            card.AttachedTo = null;

            if (card.Is().Equipment&& card.Controller != Controller && !card.Controller.Battlefield.Contains(card))
            {
                card.Controller.PutCardToBattlefield(card);
            }

            Publish(new AttachmentDetachedEvent(attachment: card, attachedTo: this));
        }
示例#11
0
        public void ProcessResults(ChosenCards results)
        {
            var aura = _aurasQueue.First();

            if (results.Count > 0)
            {
                var target = results[0];
                aura.EnchantWithoutPayingCost(target);
                _modify(aura);
            }

            _aurasQueue.Remove(aura);
        }
示例#12
0
文件: Combat.cs 项目: longde123/grove
        public void Remove(Card card)
        {
            var attacker = FindAttacker(card);

            if (attacker != null)
            {
                _attackers.Remove(attacker);
                attacker.RemoveFromCombat();
                return;
            }

            var blocker = FindBlocker(card);

            if (blocker != null)
            {
                _blockers.Remove(blocker);
                blocker.RemoveFromCombat();
            }
        }
示例#13
0
        public bool Remove(Static ability)
        {
            var matches = _all
                          .Where(x => x.Value == ability)
                          .OrderBy(x => x.IsEnabled ? 0 : 1)
                          .ToList();

            if (matches.Count == 0)
            {
                return(false);
            }

            _all.Remove(matches.First());

            if (matches.Count(x => x.IsEnabled) == 1)
            {
                _active.Remove(ability);
            }
            return(true);
        }
示例#14
0
        public void Consume(
            ManaAmount amount,
            ManaUsage usage,
            ConvokeAndDelveOptions convokeAndDelveOptions)
        {
            var allocated = TryToAllocateAmount(amount, usage, convokeAndDelveOptions);

            Asrt.True(allocated != null, "Not enough mana available.");

            var sources = GetSourcesToActivate(allocated.Units);

            foreach (var source in sources)
            {
                lock (_manaPoolCountLock)
                {
                    foreach (var unit in source.GetUnits())
                    {
                        _manaPool.Add(unit);
                    }
                }

                source.PayActivationCost();
            }

            lock (_manaPoolCountLock)
            {
                foreach (var unit in allocated.Units)
                {
                    _manaPool.Remove(unit);
                }
            }

            foreach (var unit in allocated.Units.Where(x => !x.HasSource))
            {
                RemovePermanently(unit);
            }

            _controller.Life -= allocated.Lifeloss;
        }
示例#15
0
        private void RemoveUnits(IManaAmount amount)
        {
            if (_units.Count == 0)
            {
                return;
            }

            foreach (var singleColor in amount)
            {
                for (var i = 0; i < singleColor.Count; i++)
                {
                    var unit = _units.FirstOrDefault(x => x.Color == singleColor.Color);
                    if (unit == null)
                    {
                        break;
                    }

                    _units.Remove(unit);
                    _manaCache.Remove(unit);
                }
            }
        }
示例#16
0
 public void RemoveProtectionFromColor(CardColor color)
 {
     _colors.Remove(color);
 }
示例#17
0
 public void RemoveBlocker(Blocker blocker)
 {
     _blockers.Remove(blocker);
 }
示例#18
0
 public void Remove(DamageRedirection preventaion)
 {
     _redirections.Remove(preventaion);
 }
示例#19
0
 public void RemoveModifier(PropertyModifier <T> propertyModifier)
 {
     _modifiers.Remove(propertyModifier);
     propertyModifier.Changed -= OnModifierChanged;
     UpdateValue();
 }
示例#20
0
 public void Remove(ActivatedAbility ability)
 {
     _abilities.Remove(ability);
     ability.OnAbilityRemoved();
 }
示例#21
0
 public void Remove(CostModifier costModifier)
 {
     _costModifiers.Remove(costModifier);
 }
示例#22
0
 protected virtual void Remove(Card card)
 {
     _cards.Remove(card);
     CardRemoved(this, new ZoneChangedEventArgs(card));
 }
示例#23
0
 public void Remove(DamagePrevention preventaion)
 {
     _preventions.Remove(preventaion);
 }
示例#24
0
 public void Remove(StaticAbility ability)
 {
     _abilities.Remove(ability);
     ability.Dispose();
 }
示例#25
0
 public void Remove(ContinuousEffect effect)
 {
     _continiousEffects.Remove(effect);
     effect.Deactivate();
 }
示例#26
0
 public void RemoveModifier(IPlayerModifier modifier)
 {
     _modifiers.Remove(modifier);
     modifier.Dispose();
 }
示例#27
0
 public void RemoveEmblem(Emblem emblem)
 {
     _emblems.Remove(emblem);
     Publish(new EmblemRemovedEvent(emblem));
 }
示例#28
0
 public void Remove(Step step)
 {
     _steps.Remove(step);
 }
示例#29
0
 public void Remove(TriggeredAbility ability)
 {
     _abilities.Remove(ability);
     ability.Dispose();
 }