-
Notifications
You must be signed in to change notification settings - Fork 1
From having "zones with cards" to "cards with zones" #122
Conversation
On this first pull-request only the |
I can take care of persistence and game creation, since I have acces to your repository anyway 🙃 These changes look awesome, by the way! 😃 |
(< players-connected 1) {:error messages/lobby-not-created} | ||
:else (let [second-uuid (generators/player-uuid lobby)] | ||
(-> (create-game/new-game | ||
{:player-ids [(first (:player-ids lobby)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost went crazy during the weekend til I realized that I needed to pass the player-ids to the new-game
constructor (which is perfectly logical, I might add) instead of putting them by assoc
post-construction as with the game-id
. In fact, I think the game-id
should also be passed in and added to the game in new-game
to ease the logic (everything is done at construction instead of modifying stuff afterwards)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests seem great, just got a little comment/doubt.
|
||
(defexpect join-game | ||
|
||
(let [joined-game (-> (base/create-game) :game-id base/add-player)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to use (->
? Wouldn't it be more readable not using it?
This is the beginning of what will be a huge merge.
The idea behind this is to change the fact that on the backend we had
:players
with:hand
and:rows
, both with cards on it. Now we will have a vector:cards
with all cards with it, which will have the key:location []
telling us where it is.This will make it easier to use and pass targets of abilities, which was proving to be pretty complicated.