Migrate ed-forge API change

This commit is contained in:
Felix Linker
2020-12-29 13:18:57 +01:00
parent d987c08ac8
commit d3766d9e17
6 changed files with 18 additions and 18 deletions

View File

@@ -113,7 +113,7 @@ export default class AvailableModulesMenu extends TranslatedComponent {
// Can only be true if shieldgenmaximalmass is defined, i.e. this // Can only be true if shieldgenmaximalmass is defined, i.e. this
// module must be a shield generator // module must be a shield generator
let disabled = info.props.shieldgenmaximalmass < ship.getBaseProperty('hullmass'); let disabled = info.props.shieldgenmaximalmass < ship.readProp('hullmass');
if (meta.experimental && !mountedModule.readMeta('experimental')) { if (meta.experimental && !mountedModule.readMeta('experimental')) {
disabled = disabled =
4 <= 4 <=

View File

@@ -29,9 +29,9 @@ export default class EngineProfile extends TranslatedComponent {
const { code, ship, pips, boost } = this.props; const { code, ship, pips, boost } = this.props;
// Calculate bounds for our line chart // Calculate bounds for our line chart
const minMass = ship.getBaseProperty('hullmass'); const minMass = ship.readProp('hullmass');
const maxMass = ship.getThrusters().get('enginemaximalmass'); const maxMass = ship.getThrusters().get('enginemaximalmass');
const baseSpeed = ship.getBaseProperty('speed'); const baseSpeed = ship.readProp('speed');
const baseBoost = getBoostMultiplier(ship); const baseBoost = getBoostMultiplier(ship);
const cb = (eng, boost, mass) => { const cb = (eng, boost, mass) => {
const mult = getSpeedMultipliers(ship, mass)[(boost ? 4 : eng) / 0.5]; const mult = getSpeedMultipliers(ship, mass)[(boost ? 4 : eng) / 0.5];

View File

@@ -39,7 +39,7 @@ export default class FSDProfile extends TranslatedComponent {
const { translate } = language; const { translate } = language;
const { code, ship } = this.props; const { code, ship } = this.props;
const minMass = ship.getBaseProperty('hullmass'); const minMass = ship.readProp('hullmass');
const maxMass = ship.getThrusters().get('enginemaximalmass'); const maxMass = ship.getThrusters().get('enginemaximalmass');
const mass = ship.get(LADEN_MASS); const mass = ship.get(LADEN_MASS);
const cb = (mass) => calculateJumpRange(ship, mass, Infinity, true); const cb = (mass) => calculateJumpRange(ship, mass, Infinity, true);

View File

@@ -183,16 +183,16 @@ export default class ShipSummaryTable extends TranslatedComponent {
<td>{round(ship.get(FUEL_CAPACITY))}{u.T}</td> <td>{round(ship.get(FUEL_CAPACITY))}{u.T}</td>
<td onMouseEnter={termtip.bind(null, 'TT_SUMMARY_HULL_MASS', { cap: 0 })} <td onMouseEnter={termtip.bind(null, 'TT_SUMMARY_HULL_MASS', { cap: 0 })}
onMouseLeave={hide} onMouseLeave={hide}
>{ship.getBaseProperty('hullmass')}{u.T}</td> >{ship.readProp('hullmass')}{u.T}</td>
<td onMouseEnter={termtip.bind(null, 'TT_SUMMARY_UNLADEN_MASS', { cap: 0 })} <td onMouseEnter={termtip.bind(null, 'TT_SUMMARY_UNLADEN_MASS', { cap: 0 })}
onMouseLeave={hide} onMouseLeave={hide}
>{int(ship.get(UNLADEN_MASS))}{u.T}</td> >{int(ship.get(UNLADEN_MASS))}{u.T}</td>
<td onMouseEnter={termtip.bind(null, 'TT_SUMMARY_LADEN_MASS', { cap: 0 })} <td onMouseEnter={termtip.bind(null, 'TT_SUMMARY_LADEN_MASS', { cap: 0 })}
onMouseLeave={hide} onMouseLeave={hide}
>{int(ship.get(MAXIMUM_MASS))}{u.T}</td> >{int(ship.get(MAXIMUM_MASS))}{u.T}</td>
<td>{int(ship.getBaseProperty('hardness'))}</td> <td>{int(ship.readProp('hardness'))}</td>
<td>{ship.readMeta('crew')}</td> <td>{ship.readMeta('crew')}</td>
<td>{ship.getBaseProperty('masslock')}</td> <td>{ship.readProp('masslock')}</td>
{/* TODO: boost intervall */} {/* TODO: boost intervall */}
<td>{NaN}</td> <td>{NaN}</td>
{/* TODO: resting heat */} {/* TODO: resting heat */}

View File

@@ -116,7 +116,7 @@ export default class StandardSlotSection extends SlotSection {
this._mkSlot(fsd), this._mkSlot(fsd),
this._mkSlot( this._mkSlot(
ship.getPowerDistributor(), ship.getPowerDistributor(),
(m) => moduleGet(m, 'enginescapacity') <= ship.getBaseProperty('boostenergy'), (m) => moduleGet(m, 'enginescapacity') <= ship.readProp('boostenergy'),
), ),
this._mkSlot(ship.getLifeSupport()), this._mkSlot(ship.getLifeSupport()),
this._mkSlot(ship.getSensors()), this._mkSlot(ship.getSensors()),

View File

@@ -16,24 +16,24 @@ function shipSummary(shipId) {
let coreSizes = ship.readMeta('coreSizes'); let coreSizes = ship.readMeta('coreSizes');
let summary = { let summary = {
baseArmour: ship.getBaseProperty('basearmour'), baseArmour: ship.readProp('basearmour'),
baseShieldStrength: ship.getBaseProperty('baseshieldstrength'), baseShieldStrength: ship.readProp('baseshieldstrength'),
boost: ship.getBaseProperty('boost'), boost: ship.readProp('boost'),
class: ship.readMeta('class'), class: ship.readMeta('class'),
crew: ship.readMeta('crew'), crew: ship.readMeta('crew'),
id: shipId, id: shipId,
hardness: ship.getBaseProperty('hardness'), hardness: ship.readProp('hardness'),
hpCount: 0, hpCount: 0,
hullMass: ship.getBaseProperty('hullmass'), hullMass: ship.readProp('hullmass'),
intCount: 0, intCount: 0,
manufacturer: ship.readMeta('manufacturer'), manufacturer: ship.readMeta('manufacturer'),
masslock: ship.getBaseProperty('masslock'), masslock: ship.readProp('masslock'),
maxCargo: 0, maxCargo: 0,
maxPassengers: 0, maxPassengers: 0,
hp: [0, 0, 0, 0, 0], // Utility, Small, Medium, Large, Huge hp: [0, 0, 0, 0, 0], // Utility, Small, Medium, Large, Huge
int: [0, 0, 0, 0, 0, 0, 0, 0], // Sizes 1 - 8 int: [0, 0, 0, 0, 0, 0, 0, 0], // Sizes 1 - 8
retailCost: ship.readMeta('retailCost'), retailCost: ship.readMeta('retailCost'),
speed: ship.getBaseProperty('speed'), speed: ship.readProp('speed'),
standard: [ standard: [
'powerplant', 'powerplant',
'mainengines', 'mainengines',
@@ -44,9 +44,9 @@ function shipSummary(shipId) {
'fueltank' 'fueltank'
].map(k => coreSizes[k]), ].map(k => coreSizes[k]),
agility: agility:
ship.getBaseProperty('pitch') + ship.readProp('pitch') +
ship.getBaseProperty('yaw') + ship.readProp('yaw') +
ship.getBaseProperty('roll') ship.readProp('roll')
}; };
// Count Hardpoints by class // Count Hardpoints by class