mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-30 03:23:48 +01:00
Expose exports from Material
This commit is contained in:
parent
2592c6ccd8
commit
cc0fd197c5
@ -360,6 +360,9 @@ export function NetscriptCorporation(): InternalAPI<NSCorporation> {
|
|||||||
const materialName = helpers.string(ctx, "materialName", _materialName);
|
const materialName = helpers.string(ctx, "materialName", _materialName);
|
||||||
const material = getMaterial(divisionName, cityName, materialName);
|
const material = getMaterial(divisionName, cityName, materialName);
|
||||||
const corporation = getCorporation();
|
const corporation = getCorporation();
|
||||||
|
const exports = material.exp.map((e) => {
|
||||||
|
return { div: e.ind, loc: e.city, amt: e.amt };
|
||||||
|
});
|
||||||
return {
|
return {
|
||||||
cost: material.bCost,
|
cost: material.bCost,
|
||||||
sCost: material.sCost,
|
sCost: material.sCost,
|
||||||
@ -370,6 +373,7 @@ export function NetscriptCorporation(): InternalAPI<NSCorporation> {
|
|||||||
cmp: corporation.unlockUpgrades[3] ? material.cmp : undefined,
|
cmp: corporation.unlockUpgrades[3] ? material.cmp : undefined,
|
||||||
prod: material.prd,
|
prod: material.prd,
|
||||||
sell: material.sll,
|
sell: material.sll,
|
||||||
|
exp: exports,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
getProduct:
|
getProduct:
|
||||||
|
17
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
17
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
@ -7211,10 +7211,25 @@ interface Material {
|
|||||||
prod: number;
|
prod: number;
|
||||||
/** Amount of material sold */
|
/** Amount of material sold */
|
||||||
sell: number;
|
sell: number;
|
||||||
/** cost to buy material */
|
/** Cost to buy material */
|
||||||
cost: number;
|
cost: number;
|
||||||
/** Sell cost, can be "MP+5" */
|
/** Sell cost, can be "MP+5" */
|
||||||
sCost: string | number;
|
sCost: string | number;
|
||||||
|
/** Export orders */
|
||||||
|
exp: Export[];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Export order for a material
|
||||||
|
* @public
|
||||||
|
*/
|
||||||
|
interface Export {
|
||||||
|
/** Division the material is being exported to */
|
||||||
|
div: string;
|
||||||
|
/** City the material is being exported to */
|
||||||
|
loc: string;
|
||||||
|
/** Amount of material exported */
|
||||||
|
amt: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user