mirror of
https://github.com/danbee/chess
synced 2025-03-04 08:39:06 +00:00
These should be using GameState
This commit is contained in:
parent
0649f0f937
commit
f03692c9b9
@ -18,7 +18,7 @@ defmodule ChessWeb.GameView do
|
|||||||
|
|
||||||
def state(conn, game) do
|
def state(conn, game) do
|
||||||
cond do
|
cond do
|
||||||
Game.game_over?(game) ->
|
GameState.game_over?(game) ->
|
||||||
states[game.state]
|
states[game.state]
|
||||||
your_turn?(conn, game) ->
|
your_turn?(conn, game) ->
|
||||||
"Your turn"
|
"Your turn"
|
||||||
@ -27,7 +27,7 @@ defmodule ChessWeb.GameView do
|
|||||||
end
|
end
|
||||||
|
|
||||||
def turn_class(conn, game) do
|
def turn_class(conn, game) do
|
||||||
if your_turn?(conn, game) && !Game.game_over?(game) do
|
if your_turn?(conn, game) && !GameState.game_over?(game) do
|
||||||
"your-turn"
|
"your-turn"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user