Skip to content

Commit a1c953f

Browse files
committed
IPVGO: Add support for highlighting nodes and adding small text
1 parent bee59eb commit a1c953f

4 files changed

+72
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [GoAnalysis](./bitburner.goanalysis.md) &gt; [clearAllPointHighlights](./bitburner.goanalysis.clearallpointhighlights.md)
4+
5+
## GoAnalysis.clearAllPointHighlights() method
6+
7+
Removes all highlights from the board.
8+
9+
**Signature:**
10+
11+
```typescript
12+
clearAllPointHighlights(): void;
13+
```
14+
**Returns:**
15+
16+
void
17+
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [GoAnalysis](./bitburner.goanalysis.md) &gt; [clearPointHighlight](./bitburner.goanalysis.clearpointhighlight.md)
4+
5+
## GoAnalysis.clearPointHighlight() method
6+
7+
Removes the highlight color and text from the specified node.
8+
9+
**Signature:**
10+
11+
```typescript
12+
clearPointHighlight(x, y): void;
13+
```
14+
15+
## Parameters
16+
17+
| Parameter | Type | Description |
18+
| --- | --- | --- |
19+
| x | (not declared) | the x coordinate to remove highlight from |
20+
| y | (not declared) | the y coordinate to remove highlight from |
21+
22+
**Returns:**
23+
24+
void
25+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [GoAnalysis](./bitburner.goanalysis.md) &gt; [highlightPoint](./bitburner.goanalysis.highlightpoint.md)
4+
5+
## GoAnalysis.highlightPoint() method
6+
7+
Adds a colored circle indicator to the specified point. These indicators are removed once a move is played.
8+
9+
**Signature:**
10+
11+
```typescript
12+
highlightPoint(x, y, color = "", text = ""): void;
13+
```
14+
15+
## Parameters
16+
17+
| Parameter | Type | Description |
18+
| --- | --- | --- |
19+
| x | (not declared) | the x coordinate to highlight |
20+
| y | (not declared) | the y coordinate to highlight |
21+
| color | (not declared) | _(Optional)_ optional: the color to use for the circle. Can be given an RGB string like "\#FFF000", or "none" to clear it, or one of these color names from the selected theme: "hack" (green), "hp" (red), "money" (yellow), "int" (blue), "cha" (purple) |
22+
| text | (not declared) | _(Optional)_ optional: text to add to the node (replaces the default A.1 or B5 seen on hover). Should be kept short to fit well. |
23+
24+
**Returns:**
25+
26+
void
27+

markdown/bitburner.goanalysis.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,13 @@ export interface GoAnalysis
1616

1717
| Method | Description |
1818
| --- | --- |
19+
| [clearAllPointHighlights()](./bitburner.goanalysis.clearallpointhighlights.md) | Removes all highlights from the board. |
20+
| [clearPointHighlight(x, y)](./bitburner.goanalysis.clearpointhighlight.md) | Removes the highlight color and text from the specified node. |
1921
| [getChains(boardState)](./bitburner.goanalysis.getchains.md) | <p>Returns an ID for each point. All points that share an ID are part of the same network (or "chain"). Empty points are also given chain IDs to represent continuous empty space. Dead nodes are given the value <code>null.</code></p><p>Takes an optional boardState argument; by default uses the current board state.</p><p>The data from getChains() can be used with the data from getBoardState() to see which player (or empty) each chain is</p><p>For example, a 5x5 board might look like this. There is a large chain \#1 on the left side, smaller chains 2 and 3 on the right, and a large chain 0 taking up the center of the board. <pre lang="javascript"> \[ \[ 0,0,0,3,4\], \[ 1,0,0,3,3\], \[ 1,1,0,0,0\], \[null,1,0,2,2\], \[null,1,0,2,5\], \] </pre></p> |
2022
| [getControlledEmptyNodes(boardState)](./bitburner.goanalysis.getcontrolledemptynodes.md) | <p>Returns 'X' for black, 'O' for white, or '?' for each empty point to indicate which player controls that empty point. If no single player fully encircles the empty space, it is shown as contested with '?'. "\#" are dead nodes that are not part of the subnet.</p><p>Takes an optional boardState argument; by default uses the current board state.</p><p>Filled points of any color are indicated with '.'</p><p>In this example, white encircles some space in the top-left, black encircles some in the top-right, and between their routers is contested space in the center: <pre lang="javascript"> \[ "OO..?", "OO.?.", "O.?.X", ".?.XX", "?..X\#", \] </pre></p> |
2123
| [getLiberties(boardState)](./bitburner.goanalysis.getliberties.md) | <p>Returns a number for each point, representing how many open nodes its network/chain is connected to. Empty nodes and dead nodes are shown as -1 liberties.</p><p>Takes an optional boardState argument; by default uses the current board state.</p><p>For example, a 5x5 board might look like this. The chain in the top-left touches 5 total empty nodes, and the one in the center touches four. The group in the bottom-right only has one liberty; it is in danger of being captured! <pre lang="javascript"> \[ \[-1, 5,-1,-1, 2\], \[ 5, 5,-1,-1,-1\], \[-1,-1, 4,-1,-1\], \[ 3,-1,-1, 3, 1\], \[ 3,-1,-1, 3, 1\], \] </pre></p> |
2224
| [getStats()](./bitburner.goanalysis.getstats.md) | <p>Displays the game history, captured nodes, and gained bonuses for each opponent you have played against.</p><p>The details are keyed by opponent name, in this structure:</p><p><pre lang="javascript"> { <OpponentName>: { wins: number, losses: number, winStreak: number, highestWinStreak: number, favor: number, bonusPercent: number, bonusDescription: string, } } </pre></p> |
2325
| [getValidMoves(boardState, priorBoardState, playAsWhite)](./bitburner.goanalysis.getvalidmoves.md) | <p>Shows if each point on the board is a valid move for the player. By default, analyzes the current board state. Takes an optional boardState (and an optional prior-move boardState, if desired) to analyze a custom board.</p><p>The true/false validity of each move can be retrieved via the X and Y coordinates of the move. <code>const validMoves = ns.go.analysis.getValidMoves();</code></p><p><code>const moveIsValid = validMoves[x][y];</code></p><p>Note that the \[0\]\[0\] point is shown on the bottom-left on the visual board (as is traditional), and each string represents a vertical column on the board. In other words, the printed example above can be understood to be rotated 90 degrees clockwise compared to the board UI as shown in the IPvGO subnet tab.</p><p>Also note that, when given a custom board state, only one prior move can be analyzed. This means that the superko rules (no duplicate board states in the full game history) is not supported; you will have to implement your own analysis for that.</p><p>playAsWhite is optional, and gets the current valid moves for the white player. Intended to be used when playing as white when the opponent is set to "No AI"</p> |
26+
| [highlightPoint(x, y, color, text)](./bitburner.goanalysis.highlightpoint.md) | Adds a colored circle indicator to the specified point. These indicators are removed once a move is played. |
2427
| [resetStats(resetAll)](./bitburner.goanalysis.resetstats.md) | Reset all win/loss and winstreak records for the No AI opponent. |
2528

0 commit comments

Comments
 (0)