new Builder(world)
Constructs a new automator builder
Parameters:
| Name | Type | Description |
|---|---|---|
world |
World the automator belongs to |
- Source:
Methods
automate(generator)
Sets the target generator this automator should automate.
Parameters:
| Name | Type | Description |
|---|---|---|
generator |
Generator to automate |
- Source:
Returns:
This builder for chaining
baseAmount(amount)
Sets the base amount of resources generated by this generator. This is the amount the generator generates at level 1 and is used as the base for the higher levels.
Parameters:
| Name | Type | Description |
|---|---|---|
amount |
Base amount of resources generated at level 1 |
- Source:
Returns:
This builder for chaining
build()
Constructs the automator based on the given properties.
- Source:
Returns:
The automator
callback(callback)
Sets a callback for the generator to be called when the generator has finished its processing cycle (i.e. has generated something).
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
Callback to call after generating something |
- Source:
Returns:
This builder for chaining
cooldown(cooldown)
Sets the cooldown of this generator (in seconds). This is the minimum time between processing this generator.
Parameters:
| Name | Type | Description |
|---|---|---|
cooldown |
in seconds |
- Source:
Returns:
This builder for chaining
discardRemainder()
Discard remainder of resources when generating.
- Source:
Returns:
This builder for chaining
every(seconds)
Sets the tick rate of this automator, i.e. how often this automator should do its business.
Parameters:
| Name | Type | Description |
|---|---|---|
seconds |
Tick rate in seconds |
- Source:
Returns:
This builder for chaining
generate(resource)
Sets the currency that should be generated by the generator.
Parameters:
| Name | Type | Description |
|---|---|---|
resource |
Resource to generate |
- Source:
Throws:
IllegalArgumentException Thrown if the currency is null
Returns:
This builder for chaining
multiplier(multiplier)
Sets the multiplier for resource generation. This multiplier is used in the formula (amount) = (base amount) * (multiplier) ^ (level)
Parameters:
| Name | Type | Description |
|---|---|---|
multiplier |
Amount generation multiplier per level |
- Source:
Returns:
This builder for chaining
name(name)
Sets the name for this automator.
Parameters:
| Name | Type | Description |
|---|---|---|
name |
Name |
- Source:
Returns:
This builder for chaining
name(name)
Sets the name for the generator
Parameters:
| Name | Type | Description |
|---|---|---|
name |
Name for the generator |
- Source:
Returns:
This builder for chaining
probability(probability)
Set a probability for this generator to "work" when it's processed
Parameters:
| Name | Type | Description |
|---|---|---|
probability |
Probability percentage (between 0.0 and 1.0) |
- Source:
Returns:
This builder for chaining
useRemainder()
Store remainder of resources and generate an extra when the remainder "overflows"
- Source:
Returns:
This builder for chaining