mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-27 19:37:07 +02:00
GO: Various changes before 2.6.0 (#1120)
This commit is contained in:
@@ -0,0 +1,82 @@
|
||||
import type { GoColor, GoOpponent, GoPlayType } from "@enums";
|
||||
|
||||
export type Board = (PointState | null)[][];
|
||||
|
||||
export type SimpleBoard = string[];
|
||||
|
||||
export type Move = {
|
||||
point: PointState;
|
||||
oldLibertyCount?: number | null;
|
||||
newLibertyCount?: number | null;
|
||||
createsLife?: boolean;
|
||||
};
|
||||
|
||||
type MoveType =
|
||||
| "capture"
|
||||
| "defendCapture"
|
||||
| "eyeMove"
|
||||
| "eyeBlock"
|
||||
| "pattern"
|
||||
| "growth"
|
||||
| "expansion"
|
||||
| "jump"
|
||||
| "defend"
|
||||
| "surround"
|
||||
| "corner"
|
||||
| "random";
|
||||
|
||||
type MoveFunction = () => Promise<Move | null>;
|
||||
export type MoveOptions = Record<MoveType, MoveFunction>;
|
||||
|
||||
export type EyeMove = {
|
||||
point: PointState;
|
||||
createsLife: boolean;
|
||||
};
|
||||
|
||||
export type BoardState = {
|
||||
board: Board;
|
||||
previousPlayer: GoColor | null;
|
||||
/** The previous board position as a SimpleBoard */
|
||||
previousBoard: SimpleBoard | null;
|
||||
ai: GoOpponent;
|
||||
passCount: number;
|
||||
cheatCount: number;
|
||||
};
|
||||
|
||||
export type PointState = {
|
||||
color: GoColor;
|
||||
chain: string;
|
||||
liberties: (PointState | null)[] | null;
|
||||
x: number;
|
||||
y: number;
|
||||
};
|
||||
|
||||
export type Play = {
|
||||
success: boolean;
|
||||
type: GoPlayType;
|
||||
x: number;
|
||||
y: number;
|
||||
};
|
||||
|
||||
export type Neighbor = {
|
||||
north: PointState | null;
|
||||
east: PointState | null;
|
||||
south: PointState | null;
|
||||
west: PointState | null;
|
||||
};
|
||||
|
||||
export type GoScore = {
|
||||
White: { pieces: number; territory: number; komi: number; sum: number };
|
||||
Black: { pieces: number; territory: number; komi: number; sum: number };
|
||||
};
|
||||
|
||||
export type OpponentStats = {
|
||||
wins: number;
|
||||
losses: number;
|
||||
nodes: number;
|
||||
nodePower: number;
|
||||
winStreak: number;
|
||||
oldWinStreak: number;
|
||||
highestWinStreak: number;
|
||||
favor: number;
|
||||
};
|
||||
Reference in New Issue
Block a user