mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-17 06:48:42 +02:00
IPVGO: Add new analysis method to set a custom testing board state (#2029)
This commit is contained in:
committed by
GitHub
parent
de8c8691c2
commit
17ffabdfa5
@@ -25,6 +25,7 @@ import {
|
||||
makePlayerMove,
|
||||
resetBoardState,
|
||||
resetStats,
|
||||
setTestingBoardState,
|
||||
validateBoardState,
|
||||
validateMove,
|
||||
} from "../Go/effects/netscriptGoImplementation";
|
||||
@@ -104,6 +105,15 @@ export function NetscriptGo(): InternalAPI<NSGo> {
|
||||
(resetAll = false) => {
|
||||
resetStats(!!resetAll);
|
||||
},
|
||||
setTestingBoardState: (ctx) => (_boardState, _komi) => {
|
||||
const State = validateBoardState(error(ctx), _boardState);
|
||||
if (!State) {
|
||||
error(ctx)("Invalid board state passed to setTestingBoardState()");
|
||||
return;
|
||||
}
|
||||
const komi: number | undefined = _komi !== undefined ? helpers.number(ctx, "komi", _komi) : undefined;
|
||||
return setTestingBoardState(State.board, komi);
|
||||
},
|
||||
},
|
||||
cheat: {
|
||||
getCheatSuccessChance: (ctx: NetscriptContext) => (_cheatCount, playAsWhite) => {
|
||||
|
||||
Reference in New Issue
Block a user