/// <summary> /// Adds a destination to the queue of points the AI aircraft will visit /// </summary> /// <param name="tn">The node to visit</param> public void Queue(TaxiNode tn) { if (queue.Count == 0 || queue.Peek() != tn) queue.Enqueue(tn); }
/// <summary> /// Constructs a new aircraft /// </summary> /// <param name="texture">The texture used to draw the aircraft</param> /// <param name="startAt">What node the aircraft will begin at</param> /// <param name="direction">What direction (radians) the aircraft will face</param> public Aircraft(Texture2D texture, Airport airport, TaxiNode startAt, float direction) { this.texture = texture; this.airport = airport; this.JumpTo(startAt, direction); }
/// <summary> /// Makes the aircraft forget its instructions and teleport to a place on the taxiway /// </summary> /// <param name="tn">The node to teleport to</param> /// <param name="direction">The direction (radians) to face</param> public void JumpTo(TaxiNode tn, float direction) { this.position = tn.position; this.direction = direction; Stop();//flush the queue }