mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-22 17:23:00 +02:00
IPVGO: Add support for highlighting nodes and adding small text (#1996)
This commit is contained in:
committed by
GitHub
parent
5d486e3914
commit
f6e7ef082c
@@ -4,7 +4,12 @@ import type { Play } from "../Go/Types";
|
||||
|
||||
import { Go } from "../Go/Go";
|
||||
import { helpers } from "../Netscript/NetscriptHelpers";
|
||||
import { simpleBoardFromBoard } from "../Go/boardAnalysis/boardAnalysis";
|
||||
import {
|
||||
addPointHighlight,
|
||||
clearAllPointHighlights,
|
||||
clearPointHighlight,
|
||||
simpleBoardFromBoard,
|
||||
} from "../Go/boardAnalysis/boardAnalysis";
|
||||
import {
|
||||
cheatDestroyNode,
|
||||
cheatPlayTwoMoves,
|
||||
@@ -125,6 +130,19 @@ export function NetscriptGo(): InternalAPI<NSGo> {
|
||||
const komi: number | undefined = _komi !== undefined ? helpers.number(ctx, "komi", _komi) : undefined;
|
||||
return setTestingBoardState(State.board, komi);
|
||||
},
|
||||
highlightPoint: (ctx) => (_x, _y, _color, _text) => {
|
||||
const x = helpers.number(ctx, "x", _x);
|
||||
const y = helpers.number(ctx, "y", _y);
|
||||
const color = helpers.string(ctx, "color", _color ?? "");
|
||||
const text = helpers.string(ctx, "text", _text ?? "");
|
||||
addPointHighlight(Go.currentGame, x, y, color, text);
|
||||
},
|
||||
clearPointHighlight: (ctx) => (_x, _y) => {
|
||||
const x = helpers.number(ctx, "x", _x);
|
||||
const y = helpers.number(ctx, "y", _y);
|
||||
clearPointHighlight(Go.currentGame, x, y);
|
||||
},
|
||||
clearAllPointHighlights: () => () => clearAllPointHighlights(Go.currentGame),
|
||||
},
|
||||
cheat: {
|
||||
getCheatSuccessChance: (ctx: NetscriptContext) => (_cheatCount, _playAsWhite) => {
|
||||
|
||||
Reference in New Issue
Block a user