mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-16 14:28:36 +02:00
IPVGO: Add optional board state argument to the go analysis functions (#1716)
This commit is contained in:
committed by
GitHub
parent
ecc2d92edb
commit
6df3dcdc82
@@ -24,6 +24,7 @@ import {
|
||||
handlePassTurn,
|
||||
makePlayerMove,
|
||||
resetBoardState,
|
||||
validateBoardState,
|
||||
validateMove,
|
||||
validateTurn,
|
||||
} from "../Go/effects/netscriptGoImplementation";
|
||||
@@ -78,17 +79,21 @@ export function NetscriptGo(): InternalAPI<NSGo> {
|
||||
return resetBoardState(logger(ctx), error(ctx), opponent, boardSize);
|
||||
},
|
||||
analysis: {
|
||||
getValidMoves: () => () => {
|
||||
return getValidMoves();
|
||||
getValidMoves: (ctx) => (_boardState, _priorBoardState) => {
|
||||
const State = validateBoardState(error(ctx), _boardState, _priorBoardState);
|
||||
return getValidMoves(State);
|
||||
},
|
||||
getChains: () => () => {
|
||||
return getChains();
|
||||
getChains: (ctx) => (_boardState) => {
|
||||
const State = validateBoardState(error(ctx), _boardState);
|
||||
return getChains(State?.board);
|
||||
},
|
||||
getLiberties: () => () => {
|
||||
return getLiberties();
|
||||
getLiberties: (ctx) => (_boardState) => {
|
||||
const State = validateBoardState(error(ctx), _boardState);
|
||||
return getLiberties(State?.board);
|
||||
},
|
||||
getControlledEmptyNodes: () => () => {
|
||||
return getControlledEmptyNodes();
|
||||
getControlledEmptyNodes: (ctx) => (_boardState) => {
|
||||
const State = validateBoardState(error(ctx), _boardState);
|
||||
return getControlledEmptyNodes(State?.board);
|
||||
},
|
||||
getStats: () => () => {
|
||||
return getStats();
|
||||
|
||||
Reference in New Issue
Block a user