Skip to content

Commit

Permalink
Add hexTree getter
Browse files Browse the repository at this point in the history
  • Loading branch information
lubert committed Feb 26, 2024
1 parent c4b3c60 commit 78b92bf
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/chess.ts.chess.hextree.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [chess.ts](./chess.ts.md) &gt; [Chess](./chess.ts.chess.md) &gt; [hexTree](./chess.ts.chess.hextree.md)

## Chess.hexTree property


**Signature:**

```typescript
get hexTree(): Readonly<TreeNode<HexState>>;
```
1 change: 1 addition & 0 deletions docs/chess.ts.chess.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export declare class Chess
| --- | --- | --- | --- |
| [currentNode](./chess.ts.chess.currentnode.md) | <code>readonly</code> | Readonly&lt;TreeNode&lt;GameState&gt;&gt; | |
| [header](./chess.ts.chess.header.md) | | HeaderMap | |
| [hexTree](./chess.ts.chess.hextree.md) | <code>readonly</code> | Readonly&lt;TreeNode&lt;HexState&gt;&gt; | |
| [state](./chess.ts.chess.state.md) | <code>readonly</code> | Readonly&lt;[BoardState](./chess.ts.boardstate.md)<!-- -->&gt; | |
| [tree](./chess.ts.chess.tree.md) | <code>readonly</code> | Readonly&lt;TreeNode&lt;GameState&gt;&gt; | |

Expand Down
5 changes: 5 additions & 0 deletions src/chess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ export class Chess {
return this.boardState
}

/** @public */
public get hexTree(): Readonly<TreeNode<HexState>> {
return this._tree
}

/** @public */
public get tree(): Readonly<TreeNode<GameState>> {
return this._tree.map((node) => hexToGameState(node))
Expand Down

0 comments on commit 78b92bf

Please sign in to comment.