Skip to content

Commit

Permalink
update: Sat 28 Sep 2024 11:20:41 CEST
Browse files Browse the repository at this point in the history
  • Loading branch information
cophilot committed Sep 28, 2024
1 parent aae05a3 commit c1eb96d
Show file tree
Hide file tree
Showing 20 changed files with 64 additions and 26 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"dev": "vite",
"start": "vite --open --host",
"build": "tsc -b && vite build",
"build": "pnpm run lint && tsc -b && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview",
"format": "prettier --write . --ignore-path .prettierignore"
Expand Down
2 changes: 1 addition & 1 deletion src/api/BoardScorePage/BoardScorePage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/no-explicit-any */ // TODO
import './BoardScorePage.scss';
import { useEffect, useState } from 'react';
import PlayerSwitch from '../PlayerSwitch/PlayerSwitch';
Expand Down
5 changes: 3 additions & 2 deletions src/api/BoardScoreTable/BoardScoreTable.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/no-explicit-any */ // TODO
import { useEffect, useState } from 'react';
import './BoardScoreTable.scss';
import GameStorage from '../utils/GameStorage';
import { getFunctionForWinMode, WinMode } from '../types/WinMode';
import ExtensionButtons from '../ExtensionButtons/ExtensionButtons';
import { GameDef } from '../types/GameDef';

interface BoardScoreTableProps {
definition: any;
definition: GameDef;
playerSize: number;
gameSettings: any;
onCellChange?: (rowIndex: number, playerIndex: number, value: any) => void;
Expand Down
9 changes: 6 additions & 3 deletions src/api/ExtensionButtons/ExtensionButtons.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { useEffect, useState } from 'react';
import './ExtensionButtons.scss';
import GameStorage from '../utils/GameStorage';
import { ExtensionDef, GameDef } from '../types/GameDef';

interface ExtensionButtonsProps {
definition: any;
onExtensionOn?: (extensionName: string, extensionDefinition: any) => void;
definition: GameDef;
onExtensionOn?: (
extensionName: string,
extensionDefinition: ExtensionDef,
) => void;
onExtensionOff?: (extensionName: string) => void;
}

Expand Down
4 changes: 3 additions & 1 deletion src/api/types/GameDef.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { WinMode } from './WinMode';

export interface GameDef {
title: string; // The name of the game
playerSizes: number[]; // An array of all possible player counts
Expand All @@ -10,7 +12,7 @@ export interface GameDef {
fontFamily?: string; // The font family to be used
url?: string; // The URL to the game
rulesUrl?: string; // The URL to the rules
winMode?: string; // The winnning mode
winMode?: WinMode; // The winnning mode
extensions?: { [name: string]: ExtensionDef }; // Specify Extensions
roundMapper?: { [playerCount: number]: number }; // A mapping of player count to round count
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/GameView.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import BoardScorePage from '../api/BoardScorePage/BoardScorePage';
import { GameDef } from '../api/types/GameDef';
import By from './By';
import Logo from './Logo';

interface GameViewProps {
definition: any;
definition: GameDef;
afterTabelElement?: JSX.Element;
}

Expand Down
5 changes: 4 additions & 1 deletion src/games/calico/definition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ import goalTileLeft from './assets/goal-tile-left.png';
import catTokens from './assets/cat-tokens.png';
import buttonTokens from './assets/button-tokens.png';
import FontUtils from '../../api/utils/FontUtils';
import { GameDef } from '../../api/types/GameDef';

export default function getDefinition() {
export default function getDefinition(): GameDef {
return {
title: 'Calico',
url: 'https://boardgamegeek.com/boardgame/283155/calico',
rulesUrl:
'https://www.alderac.com/wp-content/uploads/2020/09/Calico-Rules.pdf',
bgColor: '#fbf8f0',
fontColor: '#000',
primaryColor: '#142688',
Expand Down
4 changes: 2 additions & 2 deletions src/games/dorfromatik-duel/definition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ export default function getDefinition(): GameDef {
return {
title: 'Dorfromatik: Duel',
url: 'https://boardgamegeek.com/boardgame/395364/dorfromantik-the-duel',
//bgColor: '#859395',
//fontColor: 'white',
rulesUrl:
'https://pegasus.de/media/pdf/e9/7c/e3/4250231736070_Dorfromantik_Duel_Rules_EN_Web.pdf',
primaryColor: '#7ba1d4',
secondaryColor: '#ee776c',
playerSizes: [2],
Expand Down
3 changes: 2 additions & 1 deletion src/games/everdell/definition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import { GameDef } from '../../api/types/GameDef';
export default function getDefinition(): GameDef {
return {
title: 'Everdell',
url: 'https://boardgamegeek.com/boardgame/199792/everdell',
rulesUrl: 'https://cdn.1j1ju.com/medias/c6/cd/89-everdell-rulebook.pdf',
bgColor: '#5c652e',
fontColor: '#342a28',
primaryColor: '#714839',
Expand All @@ -19,7 +21,6 @@ export default function getDefinition(): GameDef {
playerSizes: [1, 2, 3, 4],
winMode: WinMode.MOST,
stripeColor: '#4b5729',
rulesUrl: 'https://cdn.1j1ju.com/medias/c6/cd/89-everdell-rulebook.pdf',
rows: [
{
name: 'Cards in Village',
Expand Down
7 changes: 6 additions & 1 deletion src/games/forest-shuffle/definition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@ import downIcon from './assets/down.png';
import leftIcon from './assets/left.png';
import rightIcon from './assets/right.png';
import caveIcon from './assets/cave.png';
export default function getDefinition() {
import { GameDef } from '../../api/types/GameDef';

export default function getDefinition(): GameDef {
return {
title: 'Forest Shuffle',
url: 'https://boardgamegeek.com/boardgame/391163/forest-shuffle',
rulesUrl:
'https://lookout-spiele.de/upload/en_forrestshuffle.html_Forest_Shuffle_175_Rules_EN_WEB_230516.pdf',
bgColor: '#dce2c9',
fontColor: '#315a39',
primaryColor: '#bbad86',
Expand Down
6 changes: 5 additions & 1 deletion src/games/harmonies/definition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ import water from './assets/water.png';
import card from './assets/card.png';
import { WinMode } from '../../api/types/WinMode';
import FontUtils from '../../api/utils/FontUtils';
import { GameDef } from '../../api/types/GameDef';

export default function getDefinition() {
export default function getDefinition(): GameDef {
return {
title: 'Harmonies',
url: 'https://boardgamegeek.com/boardgame/414317/harmonies',
rulesUrl:
'https://cdn.svc.asmodee.net/production-libellud/uploads/2024/03/LIBELLUD_HARMONIES_RULES_EN-1.pdf',
bgColor: '#deceac',
fontColor: 'black',
primaryColor: '#0094b8',
Expand Down
6 changes: 5 additions & 1 deletion src/games/lets-go-to-japan/definition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@ import moodIcon from './assets/mood.png';
import experienceIcon from './assets/experience.png';
import researchTokenIcon from './assets/research-tokens.png';
import trainsIcon from './assets/trains.png';
import { GameDef } from '../../api/types/GameDef';

export default function getDefinition() {
export default function getDefinition(): GameDef {
return {
title: "Let's Go! To Japan",
url: 'https://boardgamegeek.com/boardgame/368173/lets-go-to-japan',
rulesUrl:
'https://www.alderac.com/wp-content/uploads/2023/03/LetsGoToJapan_Influencer_EN_1P_Rulebook_FINAL-copy.pdf',
bgColor: '#f6f8f9',
fontColor: '#000',
primaryColor: '#59c4db',
Expand Down
6 changes: 5 additions & 1 deletion src/games/scout/definition.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import { GameDef } from '../../api/types/GameDef';
import { WinMode } from '../../api/types/WinMode';
import FontUtils from '../../api/utils/FontUtils';

export default function getDefinition() {
export default function getDefinition(): GameDef {
return {
title: 'Scout',
url: 'https://boardgamegeek.com/boardgame/291453/scout',
rulesUrl:
'https://onemoregame.cloud-line.com/files/SCOUT!_v2.1_English_open.pdf',
bgColor: '#FBD800',
fontColor: '#4B0082',
primaryColor: '#F08600',
Expand Down
3 changes: 3 additions & 0 deletions src/games/sea-salt-paper/definition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ import shell from './assets/shell.png';
export default function getDefinition(): GameDef {
return {
title: 'Sea Salt & Paper',
url: 'https://boardgamegeek.com/boardgame/367220/sea-salt-and-paper',
rulesUrl:
'https://cdn.1j1ju.com/medias/a5/4b/bb-sea-salt-paper-rulebook.pdf',
bgColor: '#124876',
fontColor: '#fff',
primaryColor: '#fff',
Expand Down
6 changes: 4 additions & 2 deletions src/games/seven-wonders-duel/definition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ import coins from './assets/coins.png';
import military from './assets/military.png';
import { WinMode } from '../../api/types/WinMode';
import FontUtils from '../../api/utils/FontUtils';
import { GameDef } from '../../api/types/GameDef';

export default function getDefinition() {
export default function getDefinition(): GameDef {
return {
title: 'Seven Wonders: Duel',
url: 'https://boardgamegeek.com/boardgame/173346/7-wonders-duel',
rulesUrl: 'https://cdn.1j1ju.com/medias/1a/ba/6b-7-wonders-duel-rules.pdf',
bgColor: '#fbdbb3',
//fontColor: '#000',
primaryColor: '#c59551',
secondaryColor: '#2a7c6d',
playerSizes: [2],
Expand Down
7 changes: 5 additions & 2 deletions src/games/terraforming-mars/definition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@ import treeIcon from './assets/tree.png';
import cityIcon from './assets/city.png';
import terraformingRatingIcon from './assets/terraforming-rating.png';
import victoryPointsIcon from './assets/victory-points.png';
import { GameDef } from '../../api/types/GameDef';

export default function getDefinition() {
export default function getDefinition(): GameDef {
return {
title: 'Terraforming Mars',
url: 'https://boardgamegeek.com/boardgame/167791/terraforming-mars',
rulesUrl:
'https://cdn.1j1ju.com/medias/13/3f/fb-terraforming-mars-rule.pdf',
bgColor: '#a36743',
//fontColor: '#000',
primaryColor: '#612720',
secondaryColor: '#ffe048',
fontFamily: FontUtils.FUTURISTIC,
Expand Down
3 changes: 2 additions & 1 deletion src/games/wingspan/definition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import bonusIcon from './assets/bonus.png';
import tuckedCardIcon from './assets/tucked-card.png';
import birdIcon from './assets/bird.png';
import nectarIcon from './assets/nectar.png';
import { GameDef } from '../../api/types/GameDef';

export default function getDefinition() {
export default function getDefinition(): GameDef {
return {
title: 'Wingspan',
bgColor: '#f4f5f0',
Expand Down
3 changes: 2 additions & 1 deletion src/games/wizard/definition.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { GameDef } from '../../api/types/GameDef';
import { WinMode } from '../../api/types/WinMode';

export default function getDefinition() {
export default function getDefinition(): GameDef {
return {
title: 'Wizard',
bgColor: '#1F1F1F',
Expand Down
3 changes: 2 additions & 1 deletion src/providers/ThemeProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable react-refresh/only-export-components */
import React, { ReactNode, useEffect } from 'react';
import StyleUtils from '../api/utils/StyleUtils';

Expand Down Expand Up @@ -56,7 +57,7 @@ export function ThemeProvider({ children }: Props) {

useEffect(() => {
StyleUtils.setDefaultValues(isDarkMode);
}, []);
}, [isDarkMode]);

const isDarkModeEnabled = () => {
return isDarkMode;
Expand Down
2 changes: 1 addition & 1 deletion src/views/HomeView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function HomeView() {
useEffect(() => {
document.title = 'BoardScoreHub';
StyleUtils.setDefaultValues(isDarkModeEnabled());
}, []);
}, [isDarkModeEnabled]);

const games = getSortedGameNames();
return (
Expand Down

0 comments on commit c1eb96d

Please sign in to comment.