From 6dc0ed2ab5389cd3602255248f1737d812a0c596 Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Fri, 24 Dec 2021 03:21:31 -0700 Subject: [PATCH] Add type annocations, change hostName to isHost, add players list and type --- web-svelte/src/stores.ts | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/web-svelte/src/stores.ts b/web-svelte/src/stores.ts index 5bce885..f3f1aec 100644 --- a/web-svelte/src/stores.ts +++ b/web-svelte/src/stores.ts @@ -1,5 +1,18 @@ -import { writable } from "svelte/store"; +import { writable, readable } from "svelte/store"; -export const state = writable("main-menu"); -export const myName = writable(); -export const hostName = writable(); \ No newline at end of file +export const state = writable("main-menu"); +export const myName = writable(); +export const isHost = writable(true); + + +interface Player { + name: string; + host: boolean; + colour: string; +} +export const players = readable([ + { name: `Player 1`, host: true, colour: "#00aa00" }, + { name: `Player 2`, host: false, colour: "#aaaa00" }, + { name: `Player 3`, host: false, colour: "#00aaaa" }, + { name: `Player 4`, host: false, colour: "#ffaaff" }, +]); \ No newline at end of file