Exemple #1
0
        private LinkedList <TransportPathTempVertex> GetTempVertices(TaxiPath path, out LinkedListNode <TransportPathTempVertex> pathStart,
                                                                     out LinkedListNode <TransportPathTempVertex> pathStop, out MapId[] mapIds)
        {
            var mapIdsList = new List <MapId>();

            pathStop  = null;
            pathStart = null;
            var node         = path.Nodes.First;
            var tempVertices = new LinkedList <TransportPathTempVertex>();

            while (node != null)
            {
                if (!mapIdsList.Contains(node.Value.MapId))
                {
                    mapIdsList.Add(node.Value.MapId);
                }

                var tempVertice     = new TransportPathTempVertex(0.0f, 0.0f, 0.0f, node.Value);
                var tempVerticeNode = tempVertices.AddLast(tempVertice);

                if (node.Value.IsStoppingPoint)
                {
                    pathStop = tempVerticeNode;

                    if (pathStart == null)
                    {
                        pathStart = tempVerticeNode;
                    }
                }

                node = node.Next;
            }

            if (pathStart == null)
            {
                throw new Exception("TaxiPath provided does not have any stops");
            }

            mapIds = mapIdsList.ToArray();

            return(tempVertices);
        }
Exemple #2
0
        private LinkedList <TransportPathTempVertex> GetTempVertices(TaxiPath path,
                                                                     out LinkedListNode <TransportPathTempVertex> pathStart, out LinkedListNode <TransportPathTempVertex> pathStop,
                                                                     out MapId[] mapIds)
        {
            List <MapId> mapIdList = new List <MapId>();

            pathStop  = (LinkedListNode <TransportPathTempVertex>)null;
            pathStart = (LinkedListNode <TransportPathTempVertex>)null;
            LinkedListNode <PathVertex>          linkedListNode1 = path.Nodes.First;
            LinkedList <TransportPathTempVertex> linkedList      = new LinkedList <TransportPathTempVertex>();

            for (; linkedListNode1 != null; linkedListNode1 = linkedListNode1.Next)
            {
                if (!mapIdList.Contains(linkedListNode1.Value.MapId))
                {
                    mapIdList.Add(linkedListNode1.Value.MapId);
                }
                TransportPathTempVertex transportPathTempVertex =
                    new TransportPathTempVertex(0.0f, 0.0f, 0.0f, linkedListNode1.Value);
                LinkedListNode <TransportPathTempVertex> linkedListNode2 = linkedList.AddLast(transportPathTempVertex);
                if (linkedListNode1.Value.IsStoppingPoint)
                {
                    pathStop = linkedListNode2;
                    if (pathStart == null)
                    {
                        pathStart = linkedListNode2;
                    }
                }
            }

            if (pathStart == null)
            {
                throw new Exception("TaxiPath provided does not have any stops");
            }
            mapIds = mapIdList.ToArray();
            return(linkedList);
        }
Exemple #3
0
		private LinkedList<TransportPathTempVertex> GetTempVertices(TaxiPath path, out LinkedListNode<TransportPathTempVertex> pathStart,
			out LinkedListNode<TransportPathTempVertex> pathStop, out MapId[] mapIds)
		{
			var mapIdsList = new List<MapId>();
			pathStop = null;
			pathStart = null;
			var node = path.Nodes.First;
			var tempVertices = new LinkedList<TransportPathTempVertex>();
			while (node != null)
			{
				if (!mapIdsList.Contains(node.Value.MapId))
					mapIdsList.Add(node.Value.MapId);

			    var tempVertice = new TransportPathTempVertex(0.0f, 0.0f, 0.0f, node.Value);
				var tempVerticeNode = tempVertices.AddLast(tempVertice);

				if (node.Value.IsStoppingPoint)
				{
					pathStop = tempVerticeNode;

					if (pathStart == null)
						pathStart = tempVerticeNode;
				}

				node = node.Next;
			}

			if (pathStart == null)
			{
				throw new Exception("TaxiPath provided does not have any stops");
			}

			mapIds = mapIdsList.ToArray();

			return tempVertices;
		}