private void ClearDeaths(Board defenderBoard) { Dictionary <IMinion, int> deaths = new Dictionary <IMinion, int>(); for (int i = 0; i < PlayedMinions.Count; i++) { var minion = PlayedMinions[i]; if (minion.IsDead) { deaths[minion] = i; int index = PlayedMinions.IndexOf(minion); PlayedMinions.Remove(minion); Graveyard.Add(minion); } } foreach (var kv in deaths) { kv.Key.OnDeath(new TriggerParams() { Activator = kv.Key, Board = this, RivalBoard = defenderBoard, Index = kv.Value }); OnMinionDied(kv.Key, defenderBoard); } }
public IMinion RemoveRandomMinion() { int index = RandomNumber(0, PlayedMinions.Count); var minion = PlayedMinions[index]; PlayedMinions.Remove(minion); return(minion); }
public void Remove(IMinion defendingMinion) { int i = PlayedMinions.IndexOf(defendingMinion); if (i < NextAttacker) { NextAttacker--; } PlayedMinions.Remove(defendingMinion); }
public void TryMagnet(IMinion magnetic, int index) { if (index++ > PlayedMinions.Count) { return; } var minion = PlayedMinions[index]; if ((magnetic.ValidTargets & minion.MinionType) != 0) { minion.Attack += magnetic.Attack; minion.Health += magnetic.Health; minion.Attributes |= magnetic.Attributes; PlayedMinions.Remove(magnetic); Pool.Instance.Return(magnetic); } }
public void Remove(IMinion minion) { RemoveAuras(minion); PlayedMinions.Remove(minion); }