Skip to content

Commit

Permalink
Refactor: Goban.Theme -> GobanTheme because typescript doesn't like t…
Browse files Browse the repository at this point in the history
…he former
  • Loading branch information
anoek committed Jun 15, 2024
1 parent 29c43ee commit faa2198
Show file tree
Hide file tree
Showing 10 changed files with 58 additions and 489 deletions.
8 changes: 4 additions & 4 deletions src/Goban/CanvasRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { GobanConfig } from "../GobanBase";
import { GoEngine } from "engine";
import * as GoMath from "engine/GoMath";
import { MoveTree } from "engine/MoveTree";
import { Theme, THEMES } from "./themes";
import { GobanTheme, THEMES } from "./themes";
import { MoveTreePenMarks } from "engine/MoveTree";
import {
createDeviceScaledCanvas,
Expand Down Expand Up @@ -133,18 +133,18 @@ export class GobanCanvas extends Goban implements GobanCanvasInterface {
black: "Plain",
white: "Plain",
};
private theme_black!: Theme;
private theme_black!: GobanTheme;
private theme_black_stones: Array<any> = [];
private theme_black_text_color: string = HOT_PINK;
private theme_blank_text_color: string = HOT_PINK;
private theme_board!: Theme;
private theme_board!: GobanTheme;
private theme_faded_line_color: string = HOT_PINK;
private theme_faded_star_color: string = HOT_PINK;
//private theme_faded_text_color:string;
private theme_line_color: string = "";
private theme_star_color: string = "";
private theme_stone_radius: number = 10;
private theme_white!: Theme;
private theme_white!: GobanTheme;
private theme_white_stones: Array<any> = [];
private theme_white_text_color: string = HOT_PINK;

Expand Down
3 changes: 1 addition & 2 deletions src/Goban/Goban.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { GobanConfig } from "../GobanBase";
import { callbacks } from "./callbacks";
import { makeMatrix, StoneStringBuilder } from "engine";
import { getRelativeEventPosition } from "./canvas_utils";
import { THEMES, THEMES_SORTED, Theme } from "./themes";
import { THEMES, THEMES_SORTED } from "./themes";

export const GOBAN_FONT = "Verdana,Arial,sans-serif";
export interface GobanSelectedThemes {
Expand Down Expand Up @@ -53,7 +53,6 @@ export interface GobanMetrics {
export abstract class Goban extends OGSConnectivity {
static THEMES = THEMES;
static THEMES_SORTED = THEMES_SORTED;
static Theme = Theme;

protected abstract setTheme(themes: GobanSelectedThemes, dont_redraw: boolean): void;

Expand Down
8 changes: 4 additions & 4 deletions src/Goban/SVGRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { GobanConfig } from "../GobanBase";
import { GoEngine } from "engine";
import * as GoMath from "engine/GoMath";
import { MoveTree } from "engine/MoveTree";
import { Theme, THEMES } from "./themes";
import { GobanTheme, THEMES } from "./themes";
import { MoveTreePenMarks } from "engine/MoveTree";
import { getRelativeEventPosition } from "./canvas_utils";
import { _ } from "engine/translate";
Expand Down Expand Up @@ -138,18 +138,18 @@ export class SVGRenderer extends Goban implements GobanSVGInterface {
black: "Plain",
white: "Plain",
};
private theme_black!: Theme;
private theme_black!: GobanTheme;
private theme_black_stones: Array<any> = [];
private theme_black_text_color: string = HOT_PINK;
private theme_blank_text_color: string = HOT_PINK;
private theme_board!: Theme;
private theme_board!: GobanTheme;
private theme_faded_line_color: string = HOT_PINK;
private theme_faded_star_color: string = HOT_PINK;
//private theme_faded_text_color:string;
private theme_line_color: string = "";
private theme_star_color: string = "";
private theme_stone_radius: number = 10;
private theme_white!: Theme;
private theme_white!: GobanTheme;
private theme_white_stones: Array<any> = [];
private theme_white_text_color: string = HOT_PINK;

Expand Down
Loading

0 comments on commit faa2198

Please sign in to comment.