Skip to content

Commit

Permalink
fixes island positioning and removes logs
Browse files Browse the repository at this point in the history
  • Loading branch information
jrowah committed Dec 30, 2023
1 parent 1446571 commit 8dd0aef
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions lib/islands_engine/game.ex
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,11 @@ defmodule IslandEngine.Game do

def handle_call({:position_island, player, key, row, col}, _from, state_data) do
board = player_board(state_data, player)
IO.inspect(board)

with {:ok, rules} <- Rules.check(state_data.rules, :position_island),
with {:ok, rules} <- Rules.check(state_data.rules, {:position_islands, player}),
{:ok, coordinate} <- Coordinate.new(row, col),
{:ok, island} <- Island.new(key, coordinate),
%{} = board <- Board.position_island(board, key, island) do
IO.inspect("Grut")

state_data
|> update_board(player, board)
|> update_rules(rules)
Expand All @@ -56,8 +53,6 @@ defmodule IslandEngine.Game do

{:error, :overlapping_island} ->
{:error, {:error, :overlapping_island}, state_data}

IO.inspect("Else Grut")
end
end

Expand Down

0 comments on commit 8dd0aef

Please sign in to comment.