Class: NavalManager

NavalManager()

Naval Manager Will deal with anything ships. -Basically trade over water (with fleets and goals commissioned by the economy manager) -Defense over water (commissioned by the defense manager) -Transport of units over water (a few units). -Scouting, ultimately. Also deals with handling docks, making sure we have access and stuffs like that.

Constructor

Source:

Methods

assignShipsToPlans()

assigns free ships to plans that need some
Source:

canFishSafely()

check if we can safely fish at the fish position
Source:

createTransportIfNeeded()

create a transport from a garrisoned ship to a land location needed at start game when starting with a garrisoned ship
Source:

getBestShip()

goal can be either attack (choose ship with best arrowCount) or transport (choose ship with best capacity)
Source:

getFishSea()

Get the sea, cache it if not yet done and check if in opensea
Source:

getUnconnectedSeas()

get the list of seas (or lands) around this region not connected by a dock
Source:

init()

More initialisation for stuff that needs the gameState
Source:

isShipBoarding()

Return true if this ship is likeky (un)garrisoning units
Source:

moveApart()

let blocking ships move apart from active ships (waiting for a better pathfinder) TODO Ships entity collections are currently in two parts as the trader ships are dealt with in the tradeManager. That should be modified to avoid dupplicating all the code here.
Source:

requireTransport()

complete already existing plan or create a new one for this requirement (many units can then call this separately and end up in the same plan) TODO check garrison classes
Source:

splitTransport()

split a transport plan in two, moving all entities not yet affected to a ship in the new plan
Source: