diff options
Diffstat (limited to 'src/order_backup.h')
-rw-r--r-- | src/order_backup.h | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/src/order_backup.h b/src/order_backup.h index 04913c2ac..3d4f81f92 100644 --- a/src/order_backup.h +++ b/src/order_backup.h @@ -43,34 +43,41 @@ private: VehicleOrderID orderindex; ///< The order-index the vehicle had. Order *orders; ///< The actual orders if the vehicle was not a clone. -public: /** * Create an order backup for the given vehicle. * @param v The vehicle to make a backup of. */ OrderBackup(const Vehicle *v); + /** + * Restore the data of this order to the given vehicle. + * @param v The vehicle to restore to. + */ + void DoRestore(const Vehicle *v); + +public: /** Free everything that is allocated. */ ~OrderBackup(); /** - * Restore the data of this order to the given vehicle. - * @param v The vehicle to restore to. - * @note After restoration the backup will automatically be removed. + * Create an order backup for the given vehicle. + * @param v The vehicle to make a backup of. + * @note Will automatically remove any previous backups of this user. */ - void RestoreTo(const Vehicle *v); + static void Backup(const Vehicle *v); /** - * Get the order backup associated with a given tile. - * @param t The tile to get the order backup for. - * @return The order backup, or NULL if it doesn't exist. + * Restore the data of this order to the given vehicle. + * @param v The vehicle to restore to. + * @note After restoration the backup will automatically be removed. */ - static OrderBackup *GetByTile(TileIndex t); + static void Restore(const Vehicle *v); /** * Reset the OrderBackups. + * @param tile The tile of the order backup. */ - static void Reset(); + static void Reset(TileIndex tile = INVALID_TILE); /** * Clear the group of all backups having this group ID. |