diff --git a/src/lib/stores/GameFilter.ts b/src/lib/stores/GameFilter.ts index fe88638..40523f6 100644 --- a/src/lib/stores/GameFilter.ts +++ b/src/lib/stores/GameFilter.ts @@ -1,5 +1,5 @@ import { writable, type Writable } from "svelte/store"; -const SelectedGameStore: Writable = writable(""); +const SelectedGameStore: Writable = writable(""); export default SelectedGameStore; \ No newline at end of file diff --git a/src/lib/stores/GameGroupFilter.ts b/src/lib/stores/GameGroupFilter.ts index f033750..c4001cc 100644 --- a/src/lib/stores/GameGroupFilter.ts +++ b/src/lib/stores/GameGroupFilter.ts @@ -1,5 +1,5 @@ import { writable, type Writable } from "svelte/store"; -const SelectedGameGroupsStore: Writable>> = writable(new Map()); +const SelectedGameGroupsStore: Writable>> = writable(new Map()); export default SelectedGameGroupsStore; \ No newline at end of file diff --git a/src/lib/types/chellaris.ts b/src/lib/types/chellaris.ts index 36be88e..97db3dc 100644 --- a/src/lib/types/chellaris.ts +++ b/src/lib/types/chellaris.ts @@ -1,12 +1,12 @@ -export type ChellarisInfo = { - games: Map, +export interface ChellarisInfo { + games: Map, ethics: Array, // TODO implement portraits: Array, // TODO implement } export type ChellarisGame = { name: string, - groups: Map, + groups: Map, empires: Array, // TODO implement } diff --git a/src/routes/graphs/GameGroupSelection.svelte b/src/routes/graphs/GameGroupSelection.svelte index d0806c5..f55fa3d 100644 --- a/src/routes/graphs/GameGroupSelection.svelte +++ b/src/routes/graphs/GameGroupSelection.svelte @@ -6,11 +6,11 @@ import ChellarisDataStore from '$lib/stores/ChellarisData'; import type { ChellarisGame, ChellarisGameGroup, ChellarisInfo } from '$lib/types/chellaris'; - let selectedGame: string = ''; - let selectedGameGroups: Array = []; - let selectedGameGroupsMap: Map> = new Map(); + let selectedGame: number; + let selectedGameGroups: Array = []; + let selectedGameGroupsMap: Map> = new Map(); - let gameGroups: Map = new Map(); + let gameGroups: Map = new Map(); let chellarisData: ChellarisInfo = { games: new Map(), ethics: [], @@ -20,7 +20,7 @@ // Chellaris Data Code const updateGameGroups = () => { let tmpData; - if (selectedGame == "") { + if (!selectedGame) { tmpData = chellarisData.games.get(chellarisData.games.keys().next().value); } else { @@ -28,7 +28,6 @@ } if (typeof tmpData !== 'undefined') { - console.log(tmpData.groups); gameGroups = tmpData.groups; } } diff --git a/src/routes/graphs/GameSelection.svelte b/src/routes/graphs/GameSelection.svelte index cf9d377..d37b48d 100644 --- a/src/routes/graphs/GameSelection.svelte +++ b/src/routes/graphs/GameSelection.svelte @@ -5,8 +5,8 @@ import ChellarisDataStore from '$lib/stores/ChellarisData'; import type { ChellarisGame } from '$lib/types/chellaris'; - let selectedGame = ''; - let gameList: Map = new Map(); + let selectedGame: number; + let gameList: Map = new Map(); // Chellaris Data Code ChellarisDataStore.subscribe((data) => {