Class: BaseManager

BaseManager()

Base Manager Handles lower level economic stuffs. Some tasks: -tasking workers: gathering/hunting/building/repairing?/scouting/plans. -giving feedback/estimates on GR -achieving building stuff plans (scouting/getting ressource/building) or other long-staying plans. -getting good spots for dropsites -managing dropsite use in the base -updating whatever needs updating, keeping track of stuffs (rebuilding needs…)

Constructor

new BaseManager()

Source:

Members

(static) STATE_ANCHORLESS

Anchorless base, currently with dock.
Source:

(static) STATE_CAPTURED

Captured base with an anchor.
Source:

(static) STATE_UNCONSTRUCTED

New base with a foundation anchor.
Source:

Methods

addGatherRates()

Adds the estimated gather rates from this base to the currentRates
Source:

assignResourceToDropsite()

Assign the resources around the dropsites of this basis in three areas according to distance, and sort them in each area. Moving resources (animals) and buildable resources (fields) are treated elsewhere.
Source:

assignToFoundations()

If we have some foundations, and we don't have enough builder-workers, try reassigning some other workers who are nearby AI tries to use builders sensibly, not completely stopping its econ.
Source:

checkResourceLevels()

check our resource levels and react accordingly
Source:

findBestDropsiteAndLocation() → {Object}

Source:
Returns:
- The position of the best place to build a new dropsite for the specified resource, its quality and its template name.
Type
Object

findBestDropsiteLocation()

Returns the position of the best place to build a new dropsite for the specified resource and dropsite template.
Source:

pickBuilders()

returns an entity collection of workers. They are idled immediatly and their subrole set to idle.
Source:

setAnchorlessEntity()

Set a building of an anchorless base
Source:

setWorkersIdleByPriority()

If the numbers of workers on the resources is unbalanced then set some of workers to idle so they can be reassigned by reassignIdleWorkers. TODO: actually this probably should be in the HQ.
Source:

switchGatherer()

Switch some gatherers (limited to number) from resource "from" to resource "to" and return remaining number of possible switches. Prefer FemaleCitizen for food and CitizenSoldier for other resources.
Source:

update()

Return false when the base is not active (no workers on it)
Source: