mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-22 15:43:49 +01:00
19 lines
531 B
TypeScript
19 lines
531 B
TypeScript
import { sanitizeExploits } from "./Exploits/Exploit";
|
|
|
|
import { Reviver } from "./utils/JSONReviver";
|
|
|
|
import type { PlayerObject } from "./PersonObjects/Player/PlayerObject";
|
|
|
|
export let Player: PlayerObject;
|
|
|
|
export function setPlayer(playerObj: PlayerObject): void {
|
|
Player = playerObj;
|
|
}
|
|
|
|
export function loadPlayer(saveString: string): PlayerObject {
|
|
const player = JSON.parse(saveString, Reviver);
|
|
player.money = parseFloat(player.money + "");
|
|
player.exploits = sanitizeExploits(player.exploits);
|
|
return player;
|
|
}
|