From 296aa7f2988c0a5d548f07bed4837405d6b4ec0e Mon Sep 17 00:00:00 2001 From: Oliver Akins Date: Mon, 25 Jul 2022 23:55:30 -0600 Subject: [PATCH] Modify the board to accept the position array as a prop instead of accessing the store directly. --- web-svelte/src/components/Board.svelte | 44 +++++++++++--------------- 1 file changed, 18 insertions(+), 26 deletions(-) diff --git a/web-svelte/src/components/Board.svelte b/web-svelte/src/components/Board.svelte index cb903c6..cbf64ce 100644 --- a/web-svelte/src/components/Board.svelte +++ b/web-svelte/src/components/Board.svelte @@ -1,19 +1,11 @@ @@ -21,13 +13,13 @@ board[53] = {colour: {name: "Magenta",hex: `#f9c80e`},name: `Oliver`,ship: {id:
- {#if $board[10] != null} + {#if board[10] != null}
{/if} @@ -35,13 +27,13 @@ board[53] = {colour: {name: "Magenta",hex: `#f9c80e`},name: `Oliver`,ship: {id:
- {#if $board[21] != null} + {#if board[21] != null}
{/if} @@ -49,13 +41,13 @@ board[53] = {colour: {name: "Magenta",hex: `#f9c80e`},name: `Oliver`,ship: {id:
- {#if $board[32] != null} + {#if board[32] != null}
{/if} @@ -63,13 +55,13 @@ board[53] = {colour: {name: "Magenta",hex: `#f9c80e`},name: `Oliver`,ship: {id:
- {#if $board[43] != null} + {#if board[43] != null}
{/if} @@ -84,13 +76,13 @@ board[53] = {colour: {name: "Magenta",hex: `#f9c80e`},name: `Oliver`,ship: {id: {@const boardIndex = col + (( row * 10 ) + (1 * row))}
- {#if $board[boardIndex] != null} + {#if board[boardIndex] != null}
{/if}