Пример #1
0
        /// <summary>
        /// 绑定车辆
        /// </summary>
        private void BindVehicle()
        {
            VehicleManager vehicleManager = new VehicleManager();

            VehicleID.DataSource     = vehicleManager.GetAllVehicleInfo();
            VehicleID.DataTextField  = "Name";
            VehicleID.DataValueField = "ID";
            VehicleID.DataBind();
        }
Пример #2
0
        public async Task <VehicleDTO> GetById(VehicleID id)
        {
            var vehicle = await this._repo.GetByIdAsync(id);

            if (vehicle == null)
            {
                return(null);
            }


            return(_mapper.DomainToDTO(vehicle));
        }
Пример #3
0
 /**
  * Move a chain of wagons after another wagon.
  * @param source_vehicle_id The vehicle to move a wagon away from.
  * @param source_wagon The first wagon in source_vehicle to move.
  * @param dest_vehicle_id The vehicle to move the wagons to, or -1 to create a new vehicle.
  * @param dest_wagon The wagon in dest_vehicle to place source_wagon and following wagons after.
  * @returns Whether or not moving the wagons succeeded.
  */
 public static bool MoveWagonChain(VehicleID source_vehicle_id, int source_wagon, VehicleID dest_vehicle_id, int dest_wagon)
 {
     throw null;
 }
Пример #4
0
 /// <param name="vehicle_id">The aircraft whose destination is too far away.</param>
 public AIEventAircraftDestTooFar(VehicleID vehicle_id) : base(AIEventType.ET_AIRCRAFT_DEST_TOO_FAR)
 {
     throw null;
 }
Пример #5
0
 /// <param name="vehicle_id">The vehicle that was unprofitable.</param>
 public AIEventVehicleUnprofitable(VehicleID vehicle_id) : base(AIEventType.ET_VEHICLE_UNPROFITABLE)
 {
     throw null;
 }
Пример #6
0
 /// <param name="vehicle_id">The vehicle that is lost.</param>
 public AIEventVehicleLost(VehicleID vehicle_id) : base(AIEventType.ET_VEHICLE_LOST)
 {
     throw null;
 }
Пример #7
0
        internal bool MakeRoute(TownNode fromTown, TownNode toTown)
        {
            AILog.Warning($"Building a route from {fromTown.Name} to {toTown.Name}.");
            RoadStationInfo fromStationTile = stations[fromTown.TownId];
            RoadStationInfo toStationTile   = stations[toTown.TownId];

            Edge <TownNode> foundEdge = null;

            foreach (var edge in this.Graph.Edges)
            {
                if (((edge.Node1 == fromTown) && (edge.Node2 == toTown)) || ((edge.Node2 == fromTown) && (edge.Node1 == toTown)))
                {
                    foundEdge = edge;
                }
            }

            if (foundEdge == null)
            {
                AILog.Warning($"No route found from {fromTown.Name} to {toTown.Name}.");
                return(false);
            }

            var list = new AIEngineList(AIVehicle.VT_ROAD);

            list.Valuate(AIEngine.GetMaxSpeed);
            VehicleID vehicleId = null;

            foreach (var(engineType, _) in list)
            {
                if (AICargo.HasCargoClass(AIEngine.GetCargoType(engineType), AICargo.CC_PASSENGERS))
                {
                    var price = AIEngine.GetPrice(engineType);
                    CsTestAi.EnsureMoney(price + 1000);
                    vehicleId = AIVehicle.BuildVehicle(depots[fromTown.TownId].tile, engineType);
                    break;
                }
            }

            if (vehicleId == null)
            {
                AILog.Error("No passnger vehicle found.");
            }

            if (AIVehicle.IsValidVehicle(vehicleId))
            {
                AIOrder.AppendOrder(vehicleId, fromStationTile.tile, AIOrder.OF_NONE);
                AIOrder.AppendOrder(vehicleId, toStationTile.tile, AIOrder.OF_NONE);
                AIVehicle.StartStopVehicle(vehicleId);
                if (!vehicles.ContainsKey(foundEdge))
                {
                    vehicles.Add(foundEdge, new List <VehicleID>());
                }

                var vehicleList = vehicles[foundEdge];
                vehicleList.Add(vehicleId);
                AILog.Info($"Route contains now {vehicleList.Count} vehicles.");
                return(true);
            }

            AILog.Error("Invalid vehicle.");
            return(false);
        }
Пример #8
0
 /**
  * Get the number of wagons a vehicle has.
  * @param vehicle_id The vehicle to get the number of wagons from.
  * @returns The number of wagons the vehicle has.
  */
 public static int GetNumWagons(VehicleID vehicle_id)
 {
     throw null;
 }
Пример #9
0
 /**
  * Starts or stops the given vehicle depending on the current state.
  * @param vehicle_id The vehicle to start/stop.
  * @exception AIVehicle.ERR_VEHICLE_CANNOT_START_STOP
  * @exception (For aircraft only): AIVehicle.ERR_VEHICLE_IN_FLIGHT
  * @exception (For trains only): AIVehicle.ERR_VEHICLE_NO_POWER
  * @returns True if and only if the vehicle has been started or stopped.
  */
 public static bool StartStopVehicle(VehicleID vehicle_id)
 {
     throw null;
 }
Пример #10
0
 /**
  * Sends the given vehicle to a depot for servicing. If the vehicle has
  * already been sent to a depot it continues with its normal orders instead.
  * @param vehicle_id The vehicle to send to a depot for servicing.
  * @exception AIVehicle.ERR_VEHICLE_CANNOT_SEND_TO_DEPOT
  * @returns True if the current order was changed.
  */
 public static bool SendVehicleToDepotForServicing(VehicleID vehicle_id)
 {
     throw null;
 }
Пример #11
0
 /**
  * Sends the given vehicle to a depot. If the vehicle has already been
  * sent to a depot it continues with its normal orders instead.
  * @param vehicle_id The vehicle to send to a depot.
  * @exception AIVehicle.ERR_VEHICLE_CANNOT_SEND_TO_DEPOT
  * @returns True if the current order was changed.
  */
 public static bool SendVehicleToDepot(VehicleID vehicle_id)
 {
     throw null;
 }
Пример #12
0
 /**
  * Sells all wagons from the vehicle starting from a given position.
  * @param vehicle_id The vehicle to sell a wagon from.
  * @param wagon The wagon to sell.
  * @exception AIVehicle.ERR_VEHICLE_IS_DESTROYED
  * @exception AIVehicle.ERR_VEHICLE_NOT_IN_DEPOT
  * @returns True if and only if the wagons have been sold.
  */
 public static bool SellWagonChain(VehicleID vehicle_id, int wagon)
 {
     throw null;
 }
Пример #13
0
 /**
  * Sells the given vehicle.
  * @param vehicle_id The vehicle to sell.
  * @exception AIVehicle.ERR_VEHICLE_IS_DESTROYED
  * @exception AIVehicle.ERR_VEHICLE_NOT_IN_DEPOT
  * @returns True if and only if the vehicle has been sold.
  */
 public static bool SellVehicle(VehicleID vehicle_id)
 {
     throw null;
 }
Пример #14
0
 /**
  * Refits a vehicle to the given cargo type.
  * @param vehicle_id The vehicle to refit.
  * @param cargo The cargo to refit to.
  * @exception AIVehicle.ERR_VEHICLE_CANNOT_REFIT
  * @exception AIVehicle.ERR_VEHICLE_IS_DESTROYED
  * @exception AIVehicle.ERR_VEHICLE_NOT_IN_DEPOT
  * @returns True if and only if the refit succeeded.
  */
 public static bool RefitVehicle(VehicleID vehicle_id, CargoID cargo)
 {
     throw null;
 }
Пример #15
0
 /**
  * Gets the capacity of the given vehicle when refitted to the given cargo type.
  * @param vehicle_id The vehicle to refit.
  * @param cargo The cargo to refit to.
  * @returns The capacity the vehicle will have when refited.
  */
 public static int GetRefitCapacity(VehicleID vehicle_id, CargoID cargo)
 {
     throw null;
 }
Пример #16
0
 /**
  * Get the maximum allowed distance between two orders for a vehicle.
  * The distance returned is a vehicle-type specific distance independent from other
  * map distances, you may use the result of this function to compare it
  * with the result of AIOrder.GetOrderDistance.
  * @param vehicle_id The vehicle to get the distance for.
  * @returns The maximum distance between two orders for this vehicle
  *         or 0 if the distance is unlimited.
  * @note   The unit of the order distances is unspecified and should
  *         not be compared with map distances
  * @see AIOrder.GetOrderDistance
  */
 public static int GetMaximumOrderDistance(VehicleID vehicle_id)
 {
     throw null;
 }
Пример #17
0
 /**
  * Checks whether the given vehicle is valid and owned by you.
  * @param vehicle_id The vehicle to check.
  * @returns True if and only if the vehicle is valid.
  */
 public static bool IsValidVehicle(VehicleID vehicle_id)
 {
     throw null;
 }
Пример #18
0
 /**
  * Turn the given vehicle so it'll drive the other way.
  * @param vehicle_id The vehicle to turn.
  * @returns True if and only if the vehicle has started to turn.
  * @note Vehicles cannot always be reversed. For example busses and trucks need to be running
  *  and not be inside a depot.
  */
 public static bool ReverseVehicle(VehicleID vehicle_id)
 {
     throw null;
 }
Пример #19
0
 /**
  * Set the name of a vehicle.
  * @param vehicle_id The vehicle to set the name for.
  * @param name The name for the vehicle (can be either a raw string, or a ScriptText object).
  * @exception AIError.ERR_NAME_IS_NOT_UNIQUE
  * @returns True if and only if the name was changed.
  */
 public static bool SetName(VehicleID vehicle_id, string name)
 {
     throw null;
 }
Пример #20
0
 /**
  * Get the length of a the total vehicle in 1/16's of a tile.
  * @param vehicle_id The vehicle to get the length of.
  * @returns The length of the engine.
  */
 public static int GetLength(VehicleID vehicle_id)
 {
     throw null;
 }
Пример #21
0
 /**
  * Get the amount of a specific cargo the given vehicle is transporting.
  * @param vehicle_id The vehicle to get the load amount of.
  * @param cargo The cargo to get the loaded amount for.
  * @returns The amount of the given cargo the vehicle is currently transporting.
  */
 public static int GetCargoLoad(VehicleID vehicle_id, CargoID cargo)
 {
     throw null;
 }
Пример #22
0
 /**
  * Get the group of a given vehicle.
  * @param vehicle_id The vehicle to get the group from.
  * @returns The group of the given vehicle.
  */
 public static GroupID GetGroupID(VehicleID vehicle_id)
 {
     throw null;
 }
Пример #23
0
 /// <param name="vehicle_id">The vehicle that is waiting in a depot.</param>
 public AIEventVehicleWaitingInDepot(VehicleID vehicle_id) : base(AIEventType.ET_VEHICLE_WAITING_IN_DEPOT)
 {
     throw null;
 }
Пример #24
0
 /**
  * Check if the vehicle is articulated.
  * @param vehicle_id The vehicle to check.
  * @returns True if the vehicle is articulated.
  */
 public static bool IsArticulated(VehicleID vehicle_id)
 {
     throw null;
 }
Пример #25
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;
 }
Пример #26
0
 /**
  * Check if the vehicle has shared orders.
  * @param vehicle_id The vehicle to check.
  * @returns True if the vehicle has shared orders.
  */
 public static bool HasSharedOrders(VehicleID vehicle_id)
 {
     throw null;
 }
Пример #27
0
 /// <param name="vehicle">The vehicle that crashed.</param>
 /// <param name="crash_site">Where the vehicle crashed.</param>
 /// <param name="crash_reason">The reason why the vehicle crashed.</param>
 public AIEventVehicleCrashed(VehicleID vehicle, TileIndex crash_site, AIEventVehicleCrashed.CrashReason crash_reason)
     : base(AIEventType.ET_VEHICLE_CRASHED)
 {
     throw null;
 }
Пример #28
0
 /**
  * Get the current reliability of a vehicle.
  * @param vehicle_id The vehicle to check.
  * @returns The current reliability (0-100%).
  */
 public static int GetReliability(VehicleID vehicle_id)
 {
     throw null;
 }
Пример #29
0
 /**
  * Move a vehicle to a group.
  * @param group_id The group to move the vehicle to.
  * @param vehicle_id The vehicle to move to the group.
  * @returns True if and only if the vehicle was successfully moved to the group.
  * @note A vehicle can be in only one group at the same time. To remove it from
  *  a group, move it to another or to GROUP_DEFAULT. Moving the vehicle to the
  *  given group means removing it from another group.
  */
 public static bool MoveVehicle(GroupID group_id, VehicleID vehicle_id)
 {
     throw null;
 }
Пример #30
0
 /**
  * Clones a vehicle at the given depot, copying or cloning its orders.
  * @param depot The depot where the vehicle will be build.
  * @param vehicle_id The vehicle to use as example for the new vehicle.
  * @param share_orders Should the orders be copied or shared?
  * @exception AIVehicle.ERR_VEHICLE_TOO_MANY
  * @exception AIVehicle.ERR_VEHICLE_BUILD_DISABLED
  * @exception AIVehicle.ERR_VEHICLE_WRONG_DEPOT
  * @returns The VehicleID of the new vehicle, or an invalid VehicleID when
  *   it failed. Check the return value using IsValidVehicle. In test-mode
  *   0 is returned if it was successful; any other value indicates failure.
  */
 public static VehicleID CloneVehicle(TileIndex depot, VehicleID vehicle_id, bool share_orders)
 {
     throw null;
 }