Example #1
0
        public Segment CreateSegment(Node start, Node end, SegmentDescription description)
        {
            var segment = createSegment(start, end, description);

            var dir = start.Position - end.Position;

            dir = dir.normalized;

            segment.Start = connect(segment, start, -dir);
            segment.End   = connect(segment, end, dir);

            if (segment.Start == null || segment.End == null)
            {
                throw new InvalidOperationException("Segments need starts and ends!");
            }

            segments.Add(segment);
            segment.NotifyOfCreation();

            notifyConnect(start, segment.Start);
            notifyConnect(end, segment.End);

            return(segment);
        }
Example #2
0
 public AISegment(SegmentDescription description, AIRoadManager manager) : base(description, manager)
 {
 }
Example #3
0
 protected virtual Segment createSegment(Node start, Node end, SegmentDescription description)
 {
     return(new Segment(description, this));
 }
Example #4
0
 public new AISegment CreateSegment(Node start, Node end, SegmentDescription description) => base.CreateSegment(start, end, description) as AISegment;
Example #5
0
 protected override Segment createSegment(Node start, Node end, SegmentDescription description)
 {
     return(new AISegment(description, this));
 }