mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-26 03:00:56 +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
@@ -1,7 +1,7 @@
|
||||
import type { Board, BoardState, Neighbor, Play, PointState, SimpleBoard } from "../Types";
|
||||
|
||||
import { GoValidity, GoOpponent, GoColor, GoPlayType } from "@enums";
|
||||
import { Go } from "../Go";
|
||||
import { getEmptyHighlightedPoints, Go, GoEvents } from "../Go";
|
||||
import {
|
||||
findAdjacentPointsInChain,
|
||||
findNeighbors,
|
||||
@@ -730,3 +730,18 @@ export function getPreviousMoveDetails(): Play {
|
||||
y: null,
|
||||
};
|
||||
}
|
||||
|
||||
export function addPointHighlight(board: BoardState, x: number, y: number, color: string, text: string) {
|
||||
board.highlightedPoints[x][y] = { color, text };
|
||||
GoEvents.emit();
|
||||
}
|
||||
|
||||
export function clearPointHighlight(board: BoardState, x: number, y: number) {
|
||||
board.highlightedPoints[x][y] = null;
|
||||
GoEvents.emit();
|
||||
}
|
||||
|
||||
export function clearAllPointHighlights(board: BoardState) {
|
||||
board.highlightedPoints = getEmptyHighlightedPoints(Go.currentGame.board.length);
|
||||
GoEvents.emit();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user