rm another any

This commit is contained in:
Olivier Gagnon
2022-07-18 02:31:09 -04:00
parent 1b90b42881
commit 97105b8e76
2 changed files with 5 additions and 5 deletions

View File

@ -74,11 +74,10 @@ export function NetscriptHacknet(player: IPlayer, workerScript: WorkerScript): I
const i = ctx.helper.number("i", _i);
const node = getHacknetNode(ctx, i);
const hasUpgraded = hasHacknetServers(player);
const res: any = {
const res: NodeStats = {
name: node instanceof HacknetServer ? node.hostname : node.name,
level: node.level,
ram: node instanceof HacknetServer ? node.maxRam : node.ram,
ramUsed: node instanceof HacknetServer ? node.ramUsed : undefined,
cores: node.cores,
production: node instanceof HacknetServer ? node.hashRate : node.moneyGainRatePerSecond,
timeOnline: node.onlineTimeSeconds,
@ -88,6 +87,7 @@ export function NetscriptHacknet(player: IPlayer, workerScript: WorkerScript): I
if (hasUpgraded && node instanceof HacknetServer) {
res.cache = node.cache;
res.hashCapacity = node.hashCapacity;
res.ramUsed = node.ramUsed;
}
return res;

View File

@ -627,13 +627,13 @@ export interface NodeStats {
/** Node's RAM (GB) */
ram: number;
/** Node's used RAM (GB) */
ramUsed: number;
ramUsed?: number;
/** Node's number of cores */
cores: number;
/** Cache level. Only applicable for Hacknet Servers */
cache: number;
cache?: number;
/** Hash Capacity provided by this Node. Only applicable for Hacknet Servers */
hashCapacity: number;
hashCapacity?: number;
/** Node's production per second */
production: number;
/** Number of seconds since Node has been purchased */