protected static SimDescription GetEventSim(Event e) { SimDescriptionEvent simDescEvent = e as SimDescriptionEvent; if (simDescEvent != null) { return(simDescEvent.SimDescription); } else { MiniSimDescriptionEvent miniSimEvent = e as MiniSimDescriptionEvent; if (miniSimEvent != null) { return(miniSimEvent.MiniSimDescription as SimDescription); } else { Sim sim = e.Actor as Sim; if (sim == null) { sim = e.TargetObject as Sim; if (sim == null) { return(null); } } return(sim.SimDescription); } } }
protected ListenerAction OnKill(Event e) { try { SimDescription sim = null; SimDescriptionEvent event2 = e as SimDescriptionEvent; if (event2 != null) { sim = event2.SimDescription; } else { MiniSimDescriptionEvent event3 = e as MiniSimDescriptionEvent; if (event3 != null) { sim = event3.MiniSimDescription as SimDescription; } } if (!TargetDead(sim)) { return(ListenerAction.Keep); } else { return(ListenerAction.Remove); } } catch (Exception exception) { Common.Exception(e.Actor, e.TargetObject, exception); return(ListenerAction.Keep); } }
protected static void OnDisposed(Event e) { SimDescriptionEvent dEvent = e as SimDescriptionEvent; if (dEvent != null) { Common.DebugStackLog(dEvent.SimDescription.FullName); } }
private ListenerAction OnDisposed(Event e) { SimDescription simDesc = null; try { if (!GameStates.IsWorldShuttingDown) { SimDescriptionEvent simDescEvent = e as SimDescriptionEvent; if (simDescEvent != null) { simDesc = simDescEvent.SimDescription; if ((simDesc != null) && (simDesc.SimDescriptionId != 0)) { string name = simDesc.FullName.Trim(); if (!string.IsNullOrEmpty(name)) { //Common.DebugStackLog(name); SimDisposedScenario.Task.Perform(this, simDesc); } else { //Common.DebugStackLog(name); } } } } } catch (Exception exception) { Common.Exception(simDesc, exception); } return(ListenerAction.Keep); }