Use the constant for the board size
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use crate::hand_view::HandView;
|
||||
use crate::tile_view::PlacedTileView;
|
||||
use board_shared::board::Board;
|
||||
use board_shared::board::{self, Board};
|
||||
use board_shared::expr::is_valid_guess;
|
||||
use board_shared::game::Game;
|
||||
use board_shared::tile::Tile;
|
||||
@@ -23,9 +23,9 @@ struct BoardViewProps {
|
||||
fn board_view(BoardViewProps { board, on_click }: &BoardViewProps) -> Html {
|
||||
html! {
|
||||
<table class="board">
|
||||
{ (0..25).map(|x| html! {
|
||||
{ (0..board::BOARD_SIZE).map(|x| html! {
|
||||
<tr class="board-row">
|
||||
{ (0..25).map(|y| html! {
|
||||
{ (0..board::BOARD_SIZE).map(|y| html! {
|
||||
<PlacedTileView x={x} y={y} key={x} tile={board.get(x, y)} on_click={on_click.clone()} />
|
||||
}).collect::<Html>() }
|
||||
</tr>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
use crate::tile::Tile;
|
||||
|
||||
const BOARD_SIZE: usize = 25;
|
||||
pub const BOARD_SIZE: usize = 25;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct Board {
|
||||
|
Reference in New Issue
Block a user