public void AddExternalThreat(ExternalThreat newThreat, int timeAppears, ZoneLocation zoneLocation) { newThreat.SetInitialPlacement(timeAppears, zoneLocation); newThreat.PlaceOnTrack(ExternalTracks[zoneLocation]); newThreat.AttackedSittingDuck += (sender, args) => { ThreatAttackedShip(sender, args); }; foreach (var threat in externalThreatStatusEffects.Concat(singleTurnExternalThreatStatusEffects)) { newThreat.SetThreatStatus(threat, true); } ExternalThreats.Add(newThreat); }
public Threat DrawThreat() { // check if deck is empty if (ThreatDeck.Count < 1) { return(null); } var threat = ThreatDeck.Dequeue(); if (threat is ExternalThreat et) { ExternalThreats.Add(et); } else if (threat is InternalThreat it) { InternalThreats.Add(it); } threat.OnSpawn(_eventManager); return(threat); }