Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 7 additions & 15 deletions src/games/domineering.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { GameBase, IAPGameState, IClickResult, IIndividualState, IValidationResult } from "./_base";
import { APGamesInformation } from "../schemas/gameinfo";
import { APRenderRep, Colourfuncs, RowCol } from "@abstractplay/renderer/src/schemas/schema";
import { APRenderRep, RowCol } from "@abstractplay/renderer/src/schemas/schema";
import { APMoveResult } from "../schemas/moveresults";
import { reviver, UserFacingError } from "../common";
import i18next from "i18next";
Expand Down Expand Up @@ -34,7 +34,7 @@ export class DomineeringGame extends GameBase {
people: [
{
type: "designer",
name: "John Horton Conway",
name: "Göran Andersson",
},
{
type: "coder",
Expand All @@ -52,7 +52,7 @@ export class DomineeringGame extends GameBase {
{ uid: "size-10", group: "board" },
{ uid: "quelhas", group: "ruleset" },
],
flags: ["pie", "custom-colours", "experimental"],
flags: ["pie", "experimental"],
};

public coords2algebraic(x: number, y: number): string {
Expand Down Expand Up @@ -537,13 +537,13 @@ export class DomineeringGame extends GameBase {
let markers: Array<any> | undefined = []
if (points1.length > 0) {
markers.push({ type : "flood",
colour : this.getPlayerColour(1),
colour : 1,
opacity: 1,
points : points1 as [RowCol, ...RowCol[]] });
}
if (points2.length > 0) {
markers.push({ type : "flood",
colour : this.getPlayerColour(2),
colour : 2,
opacity: 1,
points : points2 as [RowCol, ...RowCol[]] });
}
Expand All @@ -560,8 +560,8 @@ export class DomineeringGame extends GameBase {
markers,
},
legend: {
A: [{ name: "piece", colour: this.getPlayerColour(1) }],
B: [{ name: "piece", colour: this.getPlayerColour(2) }],
A: [{ name: "piece", colour: 1 }],
B: [{ name: "piece", colour: 2 }],
},
pieces: null, // pstr, // just show the floods, to better emulate dominoes
};
Expand Down Expand Up @@ -590,14 +590,6 @@ export class DomineeringGame extends GameBase {
return rep;
}

public getPlayerColour(p: playerid): Colourfuncs {
if (p === 1) {
return { func: "custom", default: 1, palette: 1 };
} else {
return { func: "custom", default: 2, palette: 2 };
}
}

public clone(): DomineeringGame {
return new DomineeringGame(this.serialize());
}
Expand Down
Loading