Skip to content

Commit

Permalink
WIP breaking out ogs-goban into separate repository
Browse files Browse the repository at this point in the history
  • Loading branch information
anoek committed Oct 2, 2019
1 parent cdd3d97 commit 267eab2
Show file tree
Hide file tree
Showing 26 changed files with 40 additions and 10,245 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
"jsonwebtoken": "^8.5.1",
"markdown-it": "^8.4.2",
"moment": "^2.24.0",
"ogs-goban": "file:../ogs-goban",
"prop-types": "^15.5.0",
"query-string": "^5.0.1",
"react": "^16.9.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import GoTheme from "../GoTheme";
import { GoTheme } from "ogs-goban";
import {_} from "../translate";
import * as data from "data";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@
* limitations under the License.
*/

import GoTheme from "../GoTheme";
import { Goban, GoTheme } from "ogs-goban";
import {_} from "../translate";
import {Goban} from '../Goban';


export default function(GoThemes) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import GoTheme from "../GoTheme";
import { GoTheme } from "ogs-goban";
import {_} from "../translate";
import * as data from "data";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@
* limitations under the License.
*/

import GoTheme from "../GoTheme";
import { GoTheme, deviceCanvasScalingRatio } from "ogs-goban";
import {_} from "../translate";
import {deviceCanvasScalingRatio} from "../GoUtil";

/**
* Converts an RGB color value to HSL. Conversion formula
Expand Down
32 changes: 29 additions & 3 deletions src/lib/goban.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ import * as preferences from "preferences";
import * as data from "data";
import * as player_cache from "player_cache";


export {GoEngine, sfx, GoThemes, GoMath} from 'ogs-goban';
export {MoveTree} from 'ogs-goban/MoveTree';
export {GoEngine, sfx, GoThemes, GoMath, MoveTree} from 'ogs-goban';

export class Goban extends OGSGoban {
constructor(config, preloaded_data?) {
Expand Down Expand Up @@ -118,3 +116,31 @@ OGSGoban.getSoundEnabled = ():boolean => {
OGSGoban.getSoundVolume = ():number => {
return preferences.get('sound-volume') as number;
};


/* Theme setup */

import { GoThemes } from "ogs-goban";
import { GoTheme } from "ogs-goban";

import init_board_plain from "./goban-themes/board_plain";
import init_board_woods from "./goban-themes/board_woods";
import init_disc from "./goban-themes/disc";
import init_rendered from "./goban-themes/rendered_stones";

init_board_plain(GoThemes);
init_board_woods(GoThemes);
init_disc(GoThemes);
init_rendered(GoThemes);

function theme_sort(a, b) {
return a.sort - b.sort;
}

for (let k in GoThemes) {
GoThemes[k].sorted = Object.keys(GoThemes[k]).map((n) => {
GoThemes[k][n].theme_name = n;
return GoThemes[k][n];
});
GoThemes[k].sorted.sort(theme_sort);
}
57 changes: 0 additions & 57 deletions src/lib/ogs-goban/GoConditionalMove.ts

This file was deleted.

Loading

0 comments on commit 267eab2

Please sign in to comment.