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:
parent
e3e5dbb7bf
commit
4b12a5a1a0
1 changed files with 4 additions and 15 deletions
|
|
@ -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 state = writable<string>("main-menu");
|
||||||
export const myName = writable<string>();
|
export const myName = writable<string>();
|
||||||
export const isHost = writable<boolean>(false);
|
export const isHost = writable<boolean>(false);
|
||||||
|
export const players = writable<PlayerData[]>();
|
||||||
|
|
||||||
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" },
|
|
||||||
]);
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue