/// <summary> /// Creates a Teleporter with the specified number of zones. /// </summary> /// <param name="zoneCount">The number of moving teleport zones.</param> public Teleporter(int zoneCount) { if (zoneCount == 0) { zoneCount = 1; } _teleportZones = new TeleportZone[zoneCount]; for (var i = 0; i < zoneCount; i++) { _teleportZones[i] = new TeleportZone(new Rectangle(225, 225, 48, 48), null, i); } }
/// <summary> /// Sets up the hack table with teleporter information. /// The hack table is used to quickly implement new types /// of sprites or implement sprites linked to immutable /// objects (like the teleporter). /// </summary> /// <param name="zone">The teleporter zone to initialize.</param> private void InitTeleporter(TeleportZone zone) { var tsZone = new TerrariumSprite(); tsZone.CurFrame = 0; tsZone.CurFrameDelta = 1; tsZone.SpriteKey = "teleporter"; tsZone.XPosition = zone.Rectangle.X; tsZone.YPosition = zone.Rectangle.Y; hackTable.Add(zone.ID, tsZone); }
/// <summary> /// Clones a TeleportZone object. /// </summary> /// <returns>A copy of the TeleportZone</returns> public TeleportZone Clone() { var zone = new TeleportZone(_rectangle, _vector, ID); return(zone); }
/// <summary> /// Clones a TeleportZone object. /// </summary> /// <returns>A copy of the TeleportZone</returns> public TeleportZone Clone() { var zone = new TeleportZone(_rectangle, _vector, ID); return zone; }
/// <summary> /// Clones a TeleportZone object. /// </summary> /// <returns>A copy of the TeleportZone</returns> public TeleportZone Clone() { TeleportZone zone = new TeleportZone(rectangle, vector, ID); return zone; }