0ad/binaries/data/mods/public/simulation/components/interfaces/Trainer.js
Freagarach 0c4f59d0a7 Split tasks from ProductionQueue.
The task of the production queue should first and foremost be that; a
queue for production items.
Hence, the specifics of training/researching are delegated to specific
components.

As a side effect, this improves the test coverage and fixes:
- Resource not refunding when hitting the entity limit. Introduced in
b8758c8941.
- Autoqueue changing when unable to spawn. Introduced in 956b3f96db.

Modders can change their templates using
https://code.wildfiregames.com/P256.

Differential revision: https://code.wildfiregames.com/D4333
Fixes: #6363
Comments by: @Silier
Refs. #6364

This was SVN commit r26000.
2021-11-16 07:08:39 +00:00

13 lines
459 B
JavaScript

Engine.RegisterInterface("Trainer");
/**
* Message of the form { "entity": number }
* sent from Trainer component to the current entity whenever a unit is about to be trained.
*/
Engine.RegisterMessageType("TrainingStarted");
/**
* Message of the form { "entities": number[], "owner": number, "metadata": object }
* sent from Trainer component to the current entity whenever a unit has been trained.
*/
Engine.RegisterMessageType("TrainingFinished");