public void ConnectTo(WormholeEndpoint targetEndpoint) { if (this.IsConnected) { throw new InvalidOperationException("This endpoint already connected."); } if (targetEndpoint.IsConnected) { throw new InvalidOperationException("Target endpoint already connected."); } this.Destination = targetEndpoint; targetEndpoint.Destination = this; }
/// <summary> /// Initializes a new instance of the <see cref="WormholeEndpoint"/> class. /// </summary> /// <param name="id">The id of the wormhole endpoint.</param> /// <param name="starSystem">The star system containing this endpoint.</param> /// <param name="trajectory">The trajectory of the endpoint.</param> public WormholeEndpoint(int id, StarSystem starSystem, Trajectory trajectory) : base(starSystem, trajectory) { this.Id = id; this.Destination = null; }