Class: Trainer

Trainer()

new Trainer()

Source:

Methods

CalculateEntitiesMap()

Calculate the new list of producible entities and update any entities currently being produced.
Source:

CanTrain(templateName) → {boolean}

Parameters:
Name Type Description
templateName string The template name to check.
Source:
Returns:
- Whether we can train this template.
Type
boolean

GetBatch() → {Object}

Source:
Returns:
- Some basic information about the training.
Type
Object

HasBatch(id) → {boolean}

Parameters:
Name Type Description
id number The ID of the batch to check.
Source:
Returns:
- Whether we are currently training the batch.
Type
boolean

Item(templateName, count, trainer, metadata)

This object represents a batch of entities being trained.
Parameters:
Name Type Description
templateName string The name of the template we ought to train.
count number The size of the batch to train.
trainer number The entity ID of our trainer.
metadata string Optionally any metadata to attach to us.
Source:

PauseBatch(id)

Parameters:
Name Type Description
id number The ID of the training.
Source:

Progress(id, allocatedTime) → {number}

Parameters:
Name Type Description
id number The ID of the item we spent time on.
allocatedTime number The time we spent on the given item.
Source:
Returns:
- The time we've actually used.
Type
number

QueueBatch(templateName, count, metadata) → {number}

Parameters:
Name Type Description
templateName string The entity to queue.
count number The batch size.
metadata string Any metadata attached to the item.
Source:
Returns:
- The ID of the item. -1 if the item could not be queued.
Type
number

StopBatch(id)

Parameters:
Name Type Description
id number The ID of the batch being trained here we need to stop.
Source:

TrainCostMultiplier() → {Object}

Source:
Returns:
- The multipliers to change the costs of any training activity with.
Type
Object