Adjust stores available.

- Remove default player objects
  - Remove Player interface
  - Make players store writable
  - Use PlayerData type from the common module
  - Add a gameCode store
This commit is contained in:
Oliver Akins 2022-03-12 23:16:49 -06:00
parent e3e5dbb7bf
commit 4b12a5a1a0
No known key found for this signature in database
GPG key ID: 3C2014AF9457AF99

View file

@ -1,19 +1,8 @@
import { writable, readable } from "svelte/store";
import type { PlayerData } from "common";
import { writable } from "svelte/store";
export const gameCode = writable<string>();
export const state = writable<string>("main-menu");
export const myName = writable<string>();
export const isHost = writable<boolean>(false);
interface Player {
name: string;
host: boolean;
colour: string;
ship: string;
}
export const players = readable<Player[]>([
{ name: `Player 1`, host: true, colour: "#00aa00", ship: "space-shuttle" },
{ name: `Player 2`, host: false, colour: "#7400b8", ship: "space-shuttle" },
{ name: `Player 3`, host: false, colour: "#faa307", ship: "space-shuttle" },
{ name: `Player 4`, host: false, colour: "#b7094c", ship: "space-shuttle" },
]);
export const players = writable<PlayerData[]>();