314 * @param erl The renewlist to search in. |
316 * @param erl The renewlist to search in. |
315 * @param engine Engine type to be replaced. |
317 * @param engine Engine type to be replaced. |
316 * @return The engine type to replace with, or INVALID_ENGINE if no |
318 * @return The engine type to replace with, or INVALID_ENGINE if no |
317 * replacement is in the list. |
319 * replacement is in the list. |
318 */ |
320 */ |
319 EngineID EngineReplacement(EngineRenewList erl, EngineID engine); |
321 EngineID EngineReplacement(EngineRenewList erl, EngineID engine, GroupID group); |
320 |
322 |
321 /** |
323 /** |
322 * Add an engine replacement to the given renewlist. |
324 * Add an engine replacement to the given renewlist. |
323 * @param erl The renewlist to add to. |
325 * @param erl The renewlist to add to. |
324 * @param old_engine The original engine type. |
326 * @param old_engine The original engine type. |
325 * @param new_engine The replacement engine type. |
327 * @param new_engine The replacement engine type. |
326 * @param flags The calling command flags. |
328 * @param flags The calling command flags. |
327 * @return 0 on success, CMD_ERROR on failure. |
329 * @return 0 on success, CMD_ERROR on failure. |
328 */ |
330 */ |
329 int32 AddEngineReplacement(EngineRenewList* erl, EngineID old_engine, EngineID new_engine, uint32 flags); |
331 int32 AddEngineReplacement(EngineRenewList* erl, EngineID old_engine, EngineID new_engine, GroupID group, uint32 flags); |
330 |
332 |
331 /** |
333 /** |
332 * Remove an engine replacement from a given renewlist. |
334 * Remove an engine replacement from a given renewlist. |
333 * @param erl The renewlist from which to remove the replacement |
335 * @param erl The renewlist from which to remove the replacement |
334 * @param engine The original engine type. |
336 * @param engine The original engine type. |
335 * @param flags The calling command flags. |
337 * @param flags The calling command flags. |
336 * @return 0 on success, CMD_ERROR on failure. |
338 * @return 0 on success, CMD_ERROR on failure. |
337 */ |
339 */ |
338 int32 RemoveEngineReplacement(EngineRenewList* erl, EngineID engine, uint32 flags); |
340 int32 RemoveEngineReplacement(EngineRenewList* erl, EngineID engine, GroupID group, uint32 flags); |
339 |
341 |
340 /** When an engine is made buildable or is removed from being buildable, add/remove it from the build/autoreplace lists |
342 /** When an engine is made buildable or is removed from being buildable, add/remove it from the build/autoreplace lists |
341 * @param type The type of engine |
343 * @param type The type of engine |
342 */ |
344 */ |
343 void AddRemoveEngineFromAutoreplaceAndBuildWindows(byte type); |
345 void AddRemoveEngineFromAutoreplaceAndBuildWindows(VehicleType type); |
344 |
346 |
345 /* Engine list manipulators - current implementation is only C wrapper of CBlobT<EngineID> class (helpers.cpp) */ |
347 /* Engine list manipulators - current implementation is only C wrapper of CBlobT<EngineID> class (helpers.cpp) */ |
346 void EngList_Create(EngineList *el); ///< Creates engine list |
348 void EngList_Create(EngineList *el); ///< Creates engine list |
347 void EngList_Destroy(EngineList *el); ///< Deallocate and destroy engine list |
349 void EngList_Destroy(EngineList *el); ///< Deallocate and destroy engine list |
348 uint EngList_Count(const EngineList *el); ///< Returns number of items in the engine list |
350 uint EngList_Count(const EngineList *el); ///< Returns number of items in the engine list |