2019-04-07 09:45:52 +00:00
|
|
|
class StationList extends AIController {
|
2014-09-21 16:44:37 +00:00
|
|
|
function Start();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2019-04-07 09:45:52 +00:00
|
|
|
function StationList::StationList()
|
2014-09-21 16:44:37 +00:00
|
|
|
{
|
|
|
|
local list = AIStationList(AIStation.STATION_BUS_STOP + AIStation.STATION_TRUCK_STOP);
|
|
|
|
|
|
|
|
print("");
|
|
|
|
print("--StationList--");
|
|
|
|
print(" Count(): " + list.Count());
|
|
|
|
list.Valuate(AIStation.GetLocation);
|
|
|
|
print(" Location ListDump:");
|
|
|
|
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
|
|
|
|
print(" " + i + " => " + list.GetValue(i));
|
|
|
|
}
|
|
|
|
list.Valuate(AIStation.GetCargoWaiting, 0);
|
|
|
|
print(" CargoWaiting(0) ListDump:");
|
|
|
|
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
|
|
|
|
print(" " + i + " => " + list.GetValue(i));
|
|
|
|
}
|
|
|
|
list.Valuate(AIStation.GetCargoWaiting, 1);
|
|
|
|
print(" CargoWaiting(1) ListDump:");
|
|
|
|
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
|
|
|
|
print(" " + i + " => " + list.GetValue(i));
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-04-07 09:45:52 +00:00
|
|
|
function StationList::StationList_Cargo()
|
2014-09-21 16:45:51 +00:00
|
|
|
{
|
|
|
|
print("");
|
|
|
|
print("--StationList_Cargo--");
|
|
|
|
|
|
|
|
for (local mode = AIStationList_Cargo.CM_WAITING; mode <= AIStationList_Cargo.CM_PLANNED; ++mode) {
|
|
|
|
print(" " + mode);
|
|
|
|
for (local selector = AIStationList_Cargo.CS_BY_FROM; selector <= AIStationList_Cargo.CS_FROM_BY_VIA ; ++selector) {
|
|
|
|
print(" " + selector);
|
|
|
|
local list = AIStationList_Cargo(mode, selector, 6, 0, 7);
|
|
|
|
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
|
|
|
|
print(" " + i + " => " + list.GetValue(i));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-04-07 09:45:52 +00:00
|
|
|
function StationList::StationList_CargoPlanned()
|
2014-09-21 16:45:51 +00:00
|
|
|
{
|
|
|
|
print("");
|
|
|
|
print("--StationList_CargoPlanned--");
|
|
|
|
|
|
|
|
for (local selector = AIStationList_Cargo.CS_BY_FROM; selector <= AIStationList_Cargo.CS_FROM_BY_VIA; ++selector) {
|
|
|
|
print(" " + selector);
|
|
|
|
local list = AIStationList_CargoPlanned(selector, 6, 0, 7);
|
|
|
|
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
|
|
|
|
print(" " + i + " => " + list.GetValue(i));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-04-07 09:45:52 +00:00
|
|
|
function StationList::StationList_CargoPlannedByFrom()
|
2014-09-21 16:45:51 +00:00
|
|
|
{
|
|
|
|
print("");
|
|
|
|
print("--StationList_CargoPlannedByFrom--");
|
|
|
|
local list = AIStationList_CargoPlannedByFrom(2, 0);
|
|
|
|
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
|
|
|
|
print(" " + i + " => " + list.GetValue(i));
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-04-07 09:45:52 +00:00
|
|
|
function StationList::StationList_CargoPlannedByVia()
|
2014-09-21 16:45:51 +00:00
|
|
|
{
|
|
|
|
print("");
|
|
|
|
print("--StationList_CargoPlannedByVia--");
|
|
|
|
local list = AIStationList_CargoPlannedByVia(2, 0);
|
|
|
|
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
|
|
|
|
print(" " + i + " => " + list.GetValue(i));
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-04-07 09:45:52 +00:00
|
|
|
function StationList::StationList_CargoPlannedViaByFrom()
|
2014-09-21 16:45:51 +00:00
|
|
|
{
|
|
|
|
print("");
|
|
|
|
print("--StationList_CargoPlannedViaByFrom--");
|
|
|
|
local list = AIStationList_CargoPlannedViaByFrom(6, 0, 7);
|
|
|
|
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
|
|
|
|
print(" " + i + " => " + list.GetValue(i));
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-04-07 09:45:52 +00:00
|
|
|
function StationList::StationList_CargoPlannedFromByVia()
|
2014-09-21 16:45:51 +00:00
|
|
|
{
|
|
|
|
print("");
|
|
|
|
print("--StationList_CargoPlannedFromByVia--");
|
|
|
|
local list = AIStationList_CargoPlannedFromByVia(6, 0, 7);
|
|
|
|
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
|
|
|
|
print(" " + i + " => " + list.GetValue(i));
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-04-07 09:45:52 +00:00
|
|
|
function StationList::StationList_CargoWaiting()
|
2014-09-21 16:45:51 +00:00
|
|
|
{
|
|
|
|
print("");
|
|
|
|
print("--StationList_CargoWaiting--");
|
|
|
|
|
|
|
|
for (local selector = AIStationList_Cargo.CS_BY_FROM; selector <= AIStationList_Cargo.CS_FROM_BY_VIA; ++selector) {
|
|
|
|
print(" " + selector);
|
|
|
|
local list = AIStationList_CargoWaiting(selector, 6, 0, 7);
|
|
|
|
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
|
|
|
|
print(" " + i + " => " + list.GetValue(i));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-04-07 09:45:52 +00:00
|
|
|
function StationList::StationList_CargoWaitingByFrom()
|
2014-09-21 16:45:51 +00:00
|
|
|
{
|
|
|
|
print("");
|
|
|
|
print("--StationList_CargoWaitingByFrom--");
|
|
|
|
local list = AIStationList_CargoWaitingByFrom(2, 0);
|
|
|
|
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
|
|
|
|
print(" " + i + " => " + list.GetValue(i));
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-04-07 09:45:52 +00:00
|
|
|
function StationList::StationList_CargoWaitingByVia()
|
2014-09-21 16:45:51 +00:00
|
|
|
{
|
|
|
|
print("");
|
|
|
|
print("--StationList_CargoWaitingByVia--");
|
|
|
|
local list = AIStationList_CargoWaitingByVia(2, 0);
|
|
|
|
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
|
|
|
|
print(" " + i + " => " + list.GetValue(i));
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-04-07 09:45:52 +00:00
|
|
|
function StationList::StationList_CargoWaitingViaByFrom()
|
2014-09-21 16:45:51 +00:00
|
|
|
{
|
|
|
|
print("");
|
|
|
|
print("--StationList_CargoWaitingViaByFrom--");
|
|
|
|
local list = AIStationList_CargoWaitingViaByFrom(6, 0, 7);
|
|
|
|
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
|
|
|
|
print(" " + i + " => " + list.GetValue(i));
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-04-07 09:45:52 +00:00
|
|
|
function StationList::StationList_CargoWaitingFromByVia()
|
2014-09-21 16:45:51 +00:00
|
|
|
{
|
|
|
|
print("");
|
|
|
|
print("--StationList_CargoWaitingFromByVia--");
|
|
|
|
local list = AIStationList_CargoWaitingFromByVia(2, 0, 2);
|
|
|
|
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
|
|
|
|
print(" " + i + " => " + list.GetValue(i));
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-04-07 09:45:52 +00:00
|
|
|
function StationList::StationList_Vehicle()
|
2014-09-21 16:44:37 +00:00
|
|
|
{
|
|
|
|
local list = AIStationList_Vehicle(12);
|
|
|
|
|
|
|
|
print("");
|
|
|
|
print("--StationList_Vehicle--");
|
|
|
|
print(" Count(): " + list.Count());
|
|
|
|
list.Valuate(AIStation.GetLocation);
|
|
|
|
print(" Location ListDump:");
|
|
|
|
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
|
|
|
|
print(" " + i + " => " + list.GetValue(i));
|
|
|
|
}
|
|
|
|
list.Valuate(AIStation.GetCargoWaiting, 0);
|
|
|
|
print(" CargoWaiting(0) ListDump:");
|
|
|
|
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
|
|
|
|
print(" " + i + " => " + list.GetValue(i));
|
|
|
|
}
|
|
|
|
list.Valuate(AIStation.GetCargoWaiting, 1);
|
|
|
|
print(" CargoWaiting(1) ListDump:");
|
|
|
|
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
|
|
|
|
print(" " + i + " => " + list.GetValue(i));
|
|
|
|
}
|
|
|
|
list.Valuate(AIStation.GetCargoRating, 1);
|
|
|
|
print(" CargoRating(1) ListDump:");
|
|
|
|
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
|
|
|
|
print(" " + i + " => " + list.GetValue(i));
|
|
|
|
}
|
|
|
|
list.Valuate(AIStation.GetDistanceManhattanToTile, 30000);
|
|
|
|
print(" DistanceManhattanToTile(30000) ListDump:");
|
|
|
|
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
|
|
|
|
print(" " + i + " => " + list.GetValue(i));
|
|
|
|
}
|
|
|
|
list.Valuate(AIStation.GetDistanceSquareToTile, 30000);
|
|
|
|
print(" DistanceSquareToTile(30000) ListDump:");
|
|
|
|
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
|
|
|
|
print(" " + i + " => " + list.GetValue(i));
|
|
|
|
}
|
|
|
|
list.Valuate(AIStation.IsWithinTownInfluence, 0);
|
|
|
|
print(" IsWithinTownInfluence(0) ListDump:");
|
|
|
|
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
|
|
|
|
print(" " + i + " => " + list.GetValue(i));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-04-07 09:45:52 +00:00
|
|
|
function StationList::Start()
|
2014-09-21 16:44:37 +00:00
|
|
|
{
|
|
|
|
StationList();
|
2014-09-21 16:45:51 +00:00
|
|
|
StationList_Cargo();
|
|
|
|
StationList_CargoPlanned();
|
|
|
|
StationList_CargoPlannedByFrom();
|
|
|
|
StationList_CargoPlannedByVia();
|
|
|
|
StationList_CargoPlannedViaByFrom();
|
|
|
|
StationList_CargoPlannedFromByVia();
|
|
|
|
StationList_CargoWaiting();
|
|
|
|
StationList_CargoWaitingByFrom();
|
|
|
|
StationList_CargoWaitingByVia();
|
|
|
|
StationList_CargoWaitingViaByFrom();
|
|
|
|
StationList_CargoWaitingFromByVia();
|
2014-09-21 16:44:37 +00:00
|
|
|
StationList_Vehicle();
|
|
|
|
}
|