public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int v = reader.ReadInt(); _Destination = reader.ReadPoint3D(); _DestinationMap = reader.ReadMap(); int count = reader.ReadInt(); for (int i = 0; i < count; i++) { if (Teleporters == null) { Teleporters = new List <InternalTeleporter>(); } InternalTeleporter tele = reader.ReadItem() as InternalTeleporter; if (tele != null) { Teleporters.Add(tele); tele.Master = this; } } }
private void AssignTeleporters() { if (Teleporters != null) { foreach (var tele in Teleporters.Where(t => t != null && !t.Deleted)) { tele.Delete(); } ColUtility.Free(Teleporters); } Teleporters = new List <InternalTeleporter>(); for (int i = 0; i <= 7; i++) { Direction offset = (Direction)i; var tele = new InternalTeleporter(this, _Destination, _DestinationMap); int x = this.X; int y = this.Y; int z = this.Z; Movement.Movement.Offset(offset, ref x, ref y); tele.MoveToWorld(new Point3D(x, y, z), this.Map); Teleporters.Add(tele); } }
protected override void EnsureConstructDefaults() { base.EnsureConstructDefaults(); Bosses = new ElementalAspect[5]; TeleportersTo = new InternalTeleporter[5]; TeleportersFrom = new InternalTeleporter[5]; Circles = new Rectangle3D[5]; Floors = new List <Static> [5]; Infos = new Pair <string, int> [5]; Stage = new List <Static>(); }