Home Reference Source
public class | source

ModuleSet

The available module set for a specific ship

Constructor Summary

Public Constructor
public

constructor(modules: Object, shipData: Object)

Instantiate the module set

Member Summary

Public Members
public
public
public

hpClass: {}

public

intClass: {}

public

internal: {}

public

mass: *

public

standard: {}

Method Summary

Public Methods
public

getBulkhead(index: integer): Object

Get the specified bulkhead

public

getHps(c: integer, eligible): Object): object

Determining the modules that are eligible for an hardpoint slot

public

getInts(ship: Object, c: integer, eligible): Object): object

Determine the modules that areeligible for an internal slot

public

Find the lightest Power Distributor that provides sufficient energy to boost.

public

lightestPowerPlant(powerNeeded: number, rating: string): Object

Find the lightest Power Plant that provides sufficient power

public

Finds the lightest usable Shield Generator

public

Finds the lightest Thruster that can handle the specified tonnage

public

matchingPowerDist(requirements: Object): Object

Find the power distributor that matches the requirements

Public Constructors

public constructor(modules: Object, shipData: Object) source

Instantiate the module set

Params:

NameTypeAttributeDescription
modules Object

All Modules

shipData Object

Ship Specifications Data (see coriolis-data/Ships)

Public Members

public bulkheads: * source

public hardpoints: {} source

public hpClass: {} source

public intClass: {} source

public internal: {} source

public mass: * source

public standard: {} source

Public Methods

public getBulkhead(index: integer): Object source

Get the specified bulkhead

Params:

NameTypeAttributeDescription
index integer

Bulkhead index

Return:

Object

Bulkhead module details

public getHps(c: integer, eligible): Object): object source

Determining the modules that are eligible for an hardpoint slot

Params:

NameTypeAttributeDescription
c integer

The max class module that can be mounted in the slot

eligible) Object

The map of eligible hardpoint groups

Return:

object

A map of all eligible modules by group

public getInts(ship: Object, c: integer, eligible): Object): object source

Determine the modules that areeligible for an internal slot

Params:

NameTypeAttributeDescription
ship Object

The ship

c integer

The max class module that can be mounted in the slot

eligible) Object

The map of eligible internal groups

Return:

object

A map of all eligible modules by group

public lightestPowerDist(boostEnergy: number): Object source

Find the lightest Power Distributor that provides sufficient energy to boost.

Params:

NameTypeAttributeDescription
boostEnergy number

The energy that is required to boost

Return:

Object

Power Distributor

public lightestPowerPlant(powerNeeded: number, rating: string): Object source

Find the lightest Power Plant that provides sufficient power

Params:

NameTypeAttributeDescription
powerNeeded number

Power requirements in MJ

rating string

The optional rating of the power plant

Return:

Object

Power Plant

public lightestShieldGenerator(hullMass: number): Object source

Finds the lightest usable Shield Generator

Params:

NameTypeAttributeDescription
hullMass number

Ship hull mass

Return:

Object

Thruster

public lightestThruster(ladenMass: number): Object source

Finds the lightest Thruster that can handle the specified tonnage

Params:

NameTypeAttributeDescription
ladenMass number

Ship laden mass (mass + cargo + fuel)

Return:

Object

Thruster

public matchingPowerDist(requirements: Object): Object source

Find the power distributor that matches the requirements

Params:

NameTypeAttributeDescription
requirements Object

The requirements to be met (currently only support 'weprate')

Return:

Object

Power distributor