public Decision Dequeue() { var next = _queue[0]; _queue.Remove(next); return(next); }
public void Detach(Card card) { _attachments.Remove(card); card.AttachedTo = null; Publish(new AttachmentDetachedEvent(attachment: card, attachedTo: this)); }
private void RemoveModifier(IModifier modifier) { _doNotUpdate.Value = modifier; _modifiers.Remove(modifier); modifier.Owner.RemoveModifier(modifier); }
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); }
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); } }
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)); }
private void RemovePermanently(ManaUnit unit) { foreach (var colorIndex in unit.Color.Indices) { _groups[colorIndex].Remove(unit); } _units.Remove(unit); }
public void Remove(Counter counter) { if (_counters.Remove(counter)) { counter.Remove(); } Publish(new CounterRemovedEvent(counter, _owningCard)); }
public void RemoveModifier(ICardModifier modifier) { _modifiers.Remove(modifier); modifier.Dispose(); if (IsPermanent) { Publish(new PermanentModifiedEvent(this, modifier)); } }
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)); }
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); }
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(); } }
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); }
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; }
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); } } }
public void RemoveProtectionFromColor(CardColor color) { _colors.Remove(color); }
public void RemoveBlocker(Blocker blocker) { _blockers.Remove(blocker); }
public void Remove(DamageRedirection preventaion) { _redirections.Remove(preventaion); }
public void RemoveModifier(PropertyModifier <T> propertyModifier) { _modifiers.Remove(propertyModifier); propertyModifier.Changed -= OnModifierChanged; UpdateValue(); }
public void Remove(ActivatedAbility ability) { _abilities.Remove(ability); ability.OnAbilityRemoved(); }
public void Remove(CostModifier costModifier) { _costModifiers.Remove(costModifier); }
protected virtual void Remove(Card card) { _cards.Remove(card); CardRemoved(this, new ZoneChangedEventArgs(card)); }
public void Remove(DamagePrevention preventaion) { _preventions.Remove(preventaion); }
public void Remove(StaticAbility ability) { _abilities.Remove(ability); ability.Dispose(); }
public void Remove(ContinuousEffect effect) { _continiousEffects.Remove(effect); effect.Deactivate(); }
public void RemoveModifier(IPlayerModifier modifier) { _modifiers.Remove(modifier); modifier.Dispose(); }
public void RemoveEmblem(Emblem emblem) { _emblems.Remove(emblem); Publish(new EmblemRemovedEvent(emblem)); }
public void Remove(Step step) { _steps.Remove(step); }
public void Remove(TriggeredAbility ability) { _abilities.Remove(ability); ability.Dispose(); }