|
2 | 2 | /* eslint-disable @typescript-eslint/no-var-requires */ |
3 | 3 | /* eslint-disable @typescript-eslint/no-unsafe-member-access */ |
4 | 4 | /* eslint-disable @typescript-eslint/no-unsafe-assignment */ |
5 | | -import { GameBase, IAPGameState, IClickResult, ICustomButton, IIndividualState, IScores, IValidationResult } from "./_base"; |
| 5 | +import { GameBase, IAPGameState, IClickResult, ICustomButton, IIndividualState, IRenderOpts, IScores, IValidationResult } from "./_base"; |
6 | 6 | import { APGamesInformation } from "../schemas/gameinfo"; |
7 | 7 | import { APRenderRep } from "@abstractplay/renderer/src/schemas/schema"; |
8 | 8 | import { APMoveResult } from "../schemas/moveresults"; |
@@ -53,6 +53,7 @@ export class GyveGame extends GameBase { |
53 | 53 | {uid: "size-12", group: "board"}, |
54 | 54 | ], |
55 | 55 | categories: ["goal>unify", "mechanic>place", "board>shape>hex", "board>connect>hex", "components>simple>1per"], |
| 56 | + displays: [{uid: "vertex-style"}], |
56 | 57 | flags: ["pie", "scores", "no-moves", "custom-randomization", "custom-buttons"] |
57 | 58 | }; |
58 | 59 |
|
@@ -471,7 +472,17 @@ export class GyveGame extends GameBase { |
471 | 472 | }; |
472 | 473 | } |
473 | 474 |
|
474 | | - public render(): APRenderRep { |
| 475 | + public render(opts?: IRenderOpts): APRenderRep { |
| 476 | + let altDisplay: string | undefined; |
| 477 | + if (opts !== undefined) { |
| 478 | + altDisplay = opts.altDisplay; |
| 479 | + } |
| 480 | + let vertexStyle = false; |
| 481 | + if (altDisplay !== undefined) { |
| 482 | + if (altDisplay === "vertex-style") { |
| 483 | + vertexStyle = true; |
| 484 | + } |
| 485 | + } |
475 | 486 | const g = this.graph; |
476 | 487 | // Build piece string |
477 | 488 | let pstr = ""; |
@@ -526,7 +537,7 @@ export class GyveGame extends GameBase { |
526 | 537 | // Build rep |
527 | 538 | const rep: APRenderRep = { |
528 | 539 | board: { |
529 | | - style: "hex-of-hex", |
| 540 | + style: vertexStyle ? "hex-of-tri" : "hex-of-hex", |
530 | 541 | minWidth: this.boardsize, |
531 | 542 | maxWidth: (this.boardsize * 2) - 1, |
532 | 543 | // markers: markers.length > 0 ? markers : undefined, |
|
0 commit comments