Class: TransportPlan

TransportPlan()

Describes a transport plan Constructor assign units (units is an ID array), a destination (position). The naval manager will try to deal with it accordingly. By this I mean that the naval manager will find how to go from access point 1 to access point 2 and then carry units from there. Note: only assign it units currently over land, or it won't work. Also: destination should probably be land, otherwise the units will be lost at sea. metadata for units: transport = this.ID onBoard = ship.id() when affected to a ship but not yet garrisoned = "onBoard" when garrisoned in a ship = undefined otherwise endPos = position of destination metadata for ships transporter = this.ID

Constructor

new TransportPlan()

Source:

Members

(static) BOARDING

We're trying to board units onto our ships.
Source:

(static) SAILING

We're moving ships and eventually unload units.
Source:

Methods

addUnit()

add a unit to this plan
Source:

cancelTransport()

TODO not currently used ... to be fixed
Source:

countFreeSlots()

count available slots
Source:

getBoardingPos()

when avoidEnnemy is true, we try to not board/unboard in ennemy territory
Source:

isOnBoard()

tell if a unit is garrisoned in one of the ships of this plan, and update its metadata if yes
Source:

removeUnit()

remove a unit from this plan, if not yet on board
Source:

update()

Try to move on and then clear the plan.
Source: