mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-26 03:00:56 +02:00
IPVGO: Support playing manually as white against your scripts using the No AI type board (#1296)
This commit is contained in:
committed by
GitHub
parent
f40d4f8e92
commit
a28bb4bd99
@@ -1,6 +1,6 @@
|
||||
import type { Board, BoardState, Neighbor, PointState, SimpleBoard } from "../Types";
|
||||
import type { Board, BoardState, Neighbor, Play, PointState, SimpleBoard } from "../Types";
|
||||
|
||||
import { GoValidity, GoOpponent, GoColor } from "@enums";
|
||||
import { GoValidity, GoOpponent, GoColor, GoPlayType } from "@enums";
|
||||
import { Go } from "../Go";
|
||||
import {
|
||||
findAdjacentPointsInChain,
|
||||
@@ -655,3 +655,23 @@ export function getPreviousMove(): [number, number] | null {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the last move, if it was made by the specified color and is present
|
||||
*/
|
||||
export function getPreviousMoveDetails(): Play {
|
||||
const priorMove = getPreviousMove();
|
||||
if (priorMove) {
|
||||
return {
|
||||
type: GoPlayType.move,
|
||||
x: priorMove[0],
|
||||
y: priorMove[1],
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
type: !priorMove && Go.currentGame?.passCount ? GoPlayType.pass : GoPlayType.gameOver,
|
||||
x: null,
|
||||
y: null,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user