public override void Serialize(GenericWriter writer) { base.Serialize(writer); writer.Write(0); writer.Write(Elementals == null ? 0 : Elementals.Count); if (Elementals != null) { Elementals.ForEach(e => writer.Write(e)); } writer.Write(ShadowguardCanals == null ? 0 : ShadowguardCanals.Count); if (ShadowguardCanals != null) { ShadowguardCanals.ForEach(c => writer.Write(c)); } writer.Write(FlowCheckers == null ? 0 : FlowCheckers.Count); if (FlowCheckers != null) { FlowCheckers.ForEach(f => f.Serialize(writer)); } }
public override void ClearItems() { if (ShadowguardCanals != null) { List <Item> list = new List <Item>(ShadowguardCanals.Where(i => i != null && !i.Deleted)); foreach (var canal in list) { canal.Delete(); } ColUtility.Free(list); ColUtility.Free(ShadowguardCanals); ShadowguardCanals = null; } if (Elementals != null) { List <BaseCreature> list = new List <BaseCreature>(Elementals.Where(t => t != null && !t.Deleted)); foreach (var elemental in list) { elemental.Delete(); } ColUtility.Free(list); ColUtility.Free(Elementals); Elementals = null; } if (FlowCheckers != null) { ColUtility.ForEach(FlowCheckers.Where(f => f != null), f => f.EndEncounter()); } }