public WrappedSegment RegisterSegment(ushort id)
        {
            if (id == 0)
            {
                return(null);
            }

            WrappedSegment segment;

            if (!RegisteredSegments.TryGetValue(id, out segment))
            {
                var node1 = RegisterNode(NetUtil.Segment(id).m_startNode);
                var node2 = RegisterNode(NetUtil.Segment(id).m_endNode);
                segment = new WrappedSegment(node1, node2, id);
                RegisteredSegments[id] = segment;
            }

            return(segment);
        }
Ejemplo n.º 2
0
        public WrappedSegment RegisterSegment(ushort id)
        {
            if (id == 0)
            {
                return(null);
            }

            WrappedSegment segment;
            WeakReference  reference;

            if (!RegisteredSegments.TryGetValue(id, out reference) || (segment = (WrappedSegment)reference.Target) == null)
            {
                var node1 = RegisterNode(NetUtil.Segment(id).m_startNode);
                var node2 = RegisterNode(NetUtil.Segment(id).m_endNode);
                segment = new WrappedSegment(node1, node2, id);
                RegisteredSegments[id] = new WeakReference(segment);
            }

            return(segment);
        }
 public NoCrossingsAction(WrappedSegment segment, bool startNode) : base("TMPE setup", false)
 {
     m_segment   = segment;
     m_startNode = startNode;
 }
 public EnteringBlockedJunctionAllowedAction(WrappedSegment segment, bool startNode, bool yieldingRoad) : base("TMPE setup", false)
 {
     m_segment      = segment;
     m_startNode    = startNode;
     m_yieldingRoad = yieldingRoad;
 }
 public YieldSignAction(WrappedSegment segment, bool startNode) : base("TMPE setup", false)
 {
     m_segment   = segment;
     m_startNode = startNode;
 }
 public NoParkingAction(WrappedSegment segment) : base("TMPE setup", false)
 {
     m_segment = segment;
 }
 public LaneChangingAction(WrappedSegment segment, bool startNode) : base("TMPE setup", false)
 {
     m_segment   = segment;
     m_startNode = startNode;
 }