Closed NiclasSP closed 3 years ago
In the API documentation it's specified that I should be getting af list of stops in return from TimeTable:getStops() but instead I am receiving the last stop in the timetable
` trainstation = component.proxy("2A68C11C4646D7B016A0F4B0D5EA9A24") trackGraph = trainstation:getTrackGraph() stations = trackGraph:getStations() trains = trackGraph:getTrains()
print("\n###" .." Trains ".. "###") for key,value in pairs(trains) do print("Name: "..value:GetName()) print("HasTimeTable: "..tostring(value.hasTimeTable)) print("DockState: "..tostring(value.dockState)) print("IsDocked: "..tostring(value.isDocked)) print("SelfDrivingError: "..tostring(value:getSelfDrivingError())) tempTimeTable = value:getTimeTable() print("NumStops: "..tempTimeTable.numStops) tempTimeTableStops = tempTimeTable:getStops() print("list?: "..tostring(tempTimeTableStops)) print("Stop Station name: "..tempTimeTableStops.station.name) print("\n") end `
Description
In the API documentation it's specified that I should be getting af list of stops in return from TimeTable:getStops() but instead I am receiving the last stop in the timetable
Code(Removed not relevant bits):
` trainstation = component.proxy("2A68C11C4646D7B016A0F4B0D5EA9A24") trackGraph = trainstation:getTrackGraph() stations = trackGraph:getStations() trains = trackGraph:getTrains()
print("\n###" .." Trains ".. "###") for key,value in pairs(trains) do print("Name: "..value:GetName()) print("HasTimeTable: "..tostring(value.hasTimeTable)) print("DockState: "..tostring(value.dockState)) print("IsDocked: "..tostring(value.isDocked)) print("SelfDrivingError: "..tostring(value:getSelfDrivingError())) tempTimeTable = value:getTimeTable() print("NumStops: "..tempTimeTable.numStops) tempTimeTableStops = tempTimeTable:getStops() print("list?: "..tostring(tempTimeTableStops)) print("Stop Station name: "..tempTimeTableStops.station.name) print("\n") end `
Code Result:
TimeTable: