示例#1
0
        private void SetStationID()
        {
            string text = File.ReadAllText(EmulatorURL);

            if (!StationID.Equals(""))
            {
                text = text.Replace("<StationID>", StationID);
                File.WriteAllText(EmulatorURL, text);
            }
        }
示例#2
0
        public void refresh(StationID stationID)
        {
            return;

            DateTime start = DateTime.Now;

            while (true)
            {
                if (!((DateTime.Now - start).TotalSeconds > 5))
                {
                    continue;
                }
                HomeController homeController = new HomeController();
                ActionResult = homeController.BusInfo(stationID);
            }
        }
示例#3
0
        private List <Arrival> sortArrivals(List <Arrival> arrivals, StationID stationID)
        {
            arrivals = arrivals.OrderBy(n => n.ExpectedArrival).ToList();
            switch (stationID.sortBy)
            {
            case "Time":
                arrivals = arrivals.OrderBy(n => n.ExpectedArrival).ToList();
                break;

            case "Destination":
                arrivals = arrivals.OrderBy(n => n.DestinationName).ToList();
                break;

            case "Direction":
                arrivals = arrivals.OrderBy(n => n.Direction).ToList();
                break;

            case "VehicleID":
                arrivals = arrivals.OrderBy(n => n.VehicleID).ToList();
                break;
            }
            return(arrivals);
        }
示例#4
0
            public override string ToString()
            {
                string header = string.Empty;

                header += Length.ToString().PadLeft(4, '0');
                header += Mid.ToString().PadLeft(4, '0');
                header += (Revision > 0) ? Revision.ToString().PadLeft(3, '0') : string.Empty.PadLeft(3, ' ');
                header += NoAckFlag.ToString().PadLeft(1, ' ');
                header += (StationID != null) ? StationID.ToString().PadLeft(2, '0') : StationID.ToString().PadLeft(2, ' ');
                header += (SpindleID != null) ? SpindleID.ToString().PadLeft(2, '0') : SpindleID.ToString().PadLeft(2, ' ');
                string usedAs = "    ";

                if (UsedAs != null)
                {
                    usedAs = string.Empty;
                    foreach (DataField field in UsedAs)
                    {
                        usedAs += field.Value.ToString();
                    }
                }
                header += usedAs;
                return(header);
            }
示例#5
0
文件: AIAirport.cs 项目: ttv86/CsNut
 /**
  * Builds a airport with tile at the topleft corner.
  * @param tile The topleft corner of the airport.
  * @param type The type of airport to build.
  * @param station_id The station to join, AIStation.STATION_NEW or AIStation.STATION_JOIN_ADJACENT.
  * @exception AIError.ERR_AREA_NOT_CLEAR
  * @exception AIError.ERR_FLAT_LAND_REQUIRED
  * @exception AIError.ERR_LOCAL_AUTHORITY_REFUSES
  * @exception AIStation.ERR_STATION_TOO_LARGE
  * @exception AIStation.ERR_STATION_TOO_CLOSE_TO_ANOTHER_STATION
  * @returns Whether the airport has been/can be build or not.
  */
 public static bool BuildAirport(TileIndex tile, AirportType type, StationID station_id)
 {
     throw null;
 }
示例#6
0
 /// <param name="station">The station containing the affected airport</param>
 public AIEventDisasterZeppelinerCleared(StationID station) : base(AIEventType.ET_DISASTER_ZEPPELINER_CLEARED)
 {
     throw null;
 }
示例#7
0
 /// <param name="station">The station visited for the first time.</param><param name="vehicle">The vehicle visiting the station.</param>
 public AIEventStationFirstVehicle(StationID station, VehicleID vehicle) : base(AIEventType.ET_STATION_FIRST_VEHICLE)
 {
     throw null;
 }
示例#8
0
 /**
  * Build a rail station.
  * @param tile Place to build the station.
  * @param direction The direction to build the station.
  * @param num_platforms The number of platforms to build.
  * @param platform_length The length of each platform.
  * @param station_id The station to join, AIStation.STATION_NEW or AIStation.STATION_JOIN_ADJACENT.
  * @exception AIError.ERR_OWNED_BY_ANOTHER_COMPANY
  * @exception AIError.ERR_AREA_NOT_CLEAR
  * @exception AIError.ERR_FLAT_LAND_REQUIRED
  * @exception AIStation.ERR_STATION_TOO_CLOSE_TO_ANOTHER_STATION
  * @exception AIStation.ERR_STATION_TOO_MANY_STATIONS
  * @exception AIStation.ERR_STATION_TOO_MANY_STATIONS_IN_TOWN
  * @returns Whether the station has been/can be build or not.
  */
 public static bool BuildRailStation(TileIndex tile, RailTrack direction, int num_platforms, int platform_length, StationID station_id)
 {
     throw null;
 }
示例#9
0
 /// <param name="station_id">The station to get the list of cargoes it accepts from.</param>
 public AICargoList_StationAccepting(StationID station_id)
 {
     throw null;
 }
示例#10
0
 /**
  * Checks whether the given basestation is valid and owned by you.
  * @param station_id The station to check.
  * @returns True if and only if the basestation is valid.
  * @note IsValidBaseStation == (IsValidStation || IsValidWaypoint).
  */
 public static bool IsValidBaseStation(StationID station_id)
 {
     throw null;
 }
示例#11
0
 /// <param name="station_id">Station to query for waiting cargo.</param><param name="cargo">Cargo type to query for.</param>
 public AIStationList_CargoWaitingByFrom(StationID station_id, CargoID cargo) : base(CargoSelector.CS_BY_FROM, station_id, cargo, null)
 {
     throw null;
 }
示例#12
0
 /**
  * Creates a list of stations associated with cargo planned to pass the station, selected and
  * grouped by the chosen criteria.
  * @param selector Mode of grouping and selecting to be applied.
  * @param station_id Station to be queried.
  * @param cargo Cargo type to query for.
  * @param other_station Other station to restrict the query with.
  */
 public AIStationList_CargoPlanned(AIStationList_Cargo.CargoSelector selector, StationID station_id, CargoID cargo, StationID other_station)
     : base(CargoMode.CM_PLANNED, selector, station_id, cargo, other_station)
 {
     throw null;
 }
示例#13
0
 /**
  * Creates a list of stations associated with waiting cargo, selected and grouped by the chosen
  * criteria.
  * @param selector Mode of grouping and selecting to be applied.
  * @param station_id Station to be queried.
  * @param cargo Cargo type to query for.
  * @param other_station Other station to restrict the query with.
  */
 public AIStationList_CargoWaiting(AIStationList_Cargo.CargoSelector selector, StationID station_id, CargoID cargo, StationID other_station)
     : base(CargoMode.CM_WAITING, selector, station_id, cargo, other_station)
 {
     throw null;
 }
示例#14
0
 /// <param name="station_id">Station to query for planned flows.</param><param name="cargo">Cargo type to query for.</param><param name="from">Origin station to restrict the query with.</param>
 public AIStationList_CargoPlannedFromByVia(StationID station_id, CargoID cargo, StationID from) : base(CargoSelector.CS_FROM_BY_VIA, station_id, cargo, from)
 {
     throw null;
 }
示例#15
0
 /// <param name="station_id">Station to query for planned flows.</param><param name="cargo">Cargo type to query for.</param>
 public AIStationList_CargoPlannedByVia(StationID station_id, CargoID cargo) : base(CargoSelector.CS_BY_VIA, station_id, cargo, null)
 {
     throw null;
 }
示例#16
0
 /// <param name="station_id">Station to query for planned flows.</param><param name="cargo">Cargo type to query for.</param><param name="via">Next hop to restrict the query with.</param>
 public AIStationList_CargoPlannedViaByFrom(StationID station_id, CargoID cargo, StationID via) : base(CargoSelector.CS_VIA_BY_FROM, station_id, cargo, via)
 {
     throw null;
 }
示例#17
0
 /**
  * Builds a dock where tile is the tile still on land.
  * @param tile The tile still on land of the dock.
  * @param station_id The station to join, AIStation.STATION_NEW or AIStation.STATION_JOIN_ADJACENT.
  * @exception AIError.ERR_AREA_NOT_CLEAR
  * @exception AIError.ERR_SITE_UNSUITABLE
  * @exception AIStation.ERR_STATION_TOO_CLOSE_TO_ANOTHER_STATION
  * @exception AIStation.ERR_STATION_TOO_MANY_STATIONS
  * @returns Whether the dock has been/can be build or not.
  */
 public static bool BuildDock(TileIndex tile, StationID station_id)
 {
     throw null;
 }
示例#18
0
 /**
  * Get the name of a basestation.
  * @param station_id The basestation to get the name of.
  * @returns The name of the station.
  */
 public static string GetName(StationID station_id)
 {
     throw null;
 }
示例#19
0
 /// <param name="station_id">The station to create the ScriptTileList for.</summary>
 /// <param name="station_type">The StationType to create the ScriptList for.</param>
 public AITileList_StationType(StationID station_id, StationType station_type)
 {
     throw null;
 }
示例#20
0
 /**
  * Set the name this basestation.
  * @param station_id The basestation to set the name of.
  * @param name The new name of the station (can be either a raw string, or a ScriptText object).
  * @exception AIError.ERR_NAME_IS_NOT_UNIQUE
  * @returns True if the name was changed.
  */
 public static bool SetName(StationID station_id, string name)
 {
     throw null;
 }
示例#21
0
 public override int GetHashCode()
 {
     return(StationName.GetHashCode() * 7 + StationID.GetHashCode());
 }
示例#22
0
 /**
  * Get the current location of a basestation.
  * @param station_id The basestation to get the location of.
  * @returns The tile the basestation sign above it.
  * @note The tile is not necessarily a station tile (and if it is, it could also belong to another station).
  * @see ScriptTileList_StationType.
  */
 public static TileIndex GetLocation(StationID station_id)
 {
     throw null;
 }
示例#23
0
 /**
  * Build a NewGRF rail station. This calls callback 18 to let a NewGRF
  *  provide the station class / id to build, so we don't end up with
  *  only the default stations on the map.
  * When no NewGRF provides a rail station, or an unbuildable rail station is
  *  returned by a NewGRF, this function will fall back to building a default
  *  non-NewGRF station as if AIRail.BuildRailStation was called.
  * @param tile Place to build the station.
  * @param direction The direction to build the station.
  * @param num_platforms The number of platforms to build.
  * @param platform_length The length of each platform.
  * @param station_id The station to join, AIStation.STATION_NEW or AIStation.STATION_JOIN_ADJACENT.
  * @param cargo_id The CargoID of the cargo that will be transported from / to this station.
  * @param source_industry The IndustryType of the industry you'll transport goods from, AIIndustryType.INDUSTRYTYPE_UNKNOWN or AIIndustryType.INDUSTRYTYPE_TOWN.
  * @param goal_industry The IndustryType of the industry you'll transport goods to, AIIndustryType.INDUSTRYTYPE_UNKNOWN or AIIndustryType.INDUSTRYTYPE_TOWN.
  * @param distance The manhattan distance you'll transport the cargo over.
  * @param source_station True if this is the source station, false otherwise.
  * @exception AIError.ERR_OWNED_BY_ANOTHER_COMPANY
  * @exception AIError.ERR_AREA_NOT_CLEAR
  * @exception AIError.ERR_FLAT_LAND_REQUIRED
  * @exception AIStation.ERR_STATION_TOO_CLOSE_TO_ANOTHER_STATION
  * @exception AIStation.ERR_STATION_TOO_MANY_STATIONS
  * @exception AIStation.ERR_STATION_TOO_MANY_STATIONS_IN_TOWN
  * @returns Whether the station has been/can be build or not.
  */
 public static bool BuildNewGRFRailStation(TileIndex tile, RailTrack direction, int num_platforms, int platform_length, StationID station_id, CargoID cargo_id, IndustryType source_industry, IndustryType goal_industry, int distance, bool source_station)
 {
     throw null;
 }
示例#24
0
 /**
  * Get the last date a station part was added to this station.
  * @param station_id The station to look at.
  * @returns The last date some part of this station was build.
  */
 public static Date GetConstructionDate(StationID station_id)
 {
     throw null;
 }
示例#25
0
 /// <param name="station">The station containing the affected airport</param>
 public AIEventDisasterZeppelinerCrashed(StationID station) : base(AIEventType.ET_DISASTER_ZEPPELINER_CRASHED)
 {
     throw null;
 }
示例#26
0
 /**
  * Checks whether the given waypoint is valid and owned by you.
  * @param waypoint_id The waypoint to check.
  * @returns True if and only if the waypoint is valid.
  */
 public static bool IsValidWaypoint(StationID waypoint_id)
 {
     throw null;
 }
示例#27
0
 /**
  * Check if any part of the waypoint contains a waypoint of the type waypoint_type
  * @param waypoint_id The waypoint to look at.
  * @param waypoint_type The WaypointType to look for.
  * @returns True if the waypoint has a waypoint part of the type waypoint_type.
  */
 public static bool HasWaypointType(StationID waypoint_id, WaypointType waypoint_type)
 {
     throw null;
 }
示例#28
0
        public ActionResult BusInfo(StationID stationID)
        {
            var info = new BusInfo(stationID);

            return(View(info));
        }
示例#29
0
 public BusInfo(StationID stationID)
 {
     Arrivals   = sortArrivals(GetArrivals.ReturnArrivals(stationID.naptamID), stationID);
     naptamID   = stationID.naptamID;
     CommonName = stationID.commonName;
 }
示例#30
0
 /// <param name="station_id">The station to get the list of vehicles from, which have orders to it.</param>
 public AIVehicleList_Station(StationID station_id)
 {
     throw null;
 }