Liking cljdoc? Tell your friends :D

thirty-one.gamestate

Builds and edits the gamestate

Builds and edits the gamestate
raw docstring

add-playerclj

(add-player gamestate player-name)

Adds a player to the gamestate

Adds a player to the gamestate
sourceraw docstring

dealclj

(deal gamestate)

Deals 3 cards to each player, then one to :discard

Deals 3 cards to each player, then one to `:discard`
sourceraw docstring

dec-lifeclj

(dec-life gamestate player-index)

Subtracts a life from the player at player-index

Subtracts a life from the player at `player-index`
sourceraw docstring

discardclj

(discard gamestate player-index card-index)

Removes the card at card-index from the hand of the player at player-index, sets the gamestate's :discard to that card

Removes the card at `card-index` from the hand of the player at `player-index`, sets the `gamestate`'s `:discard` to that card
sourceraw docstring

draw-from-deckclj

(draw-from-deck gamestate player-index)

Adds the first card in the :deck to the hand of the player at player-index

Adds the first card in the `:deck` to the hand of the player at `player-index`
sourceraw docstring

draw-from-discardclj

(draw-from-discard gamestate player-index)

Adds the card from :discard to the hand of the player at player-index

Adds the card from `:discard` to the hand of the player at `player-index`
sourceraw docstring

empty-handsclj

(empty-hands gamestate)
(empty-hands gamestate player-index)

Removes all cards from each :player's hand

Removes all cards from each `:player`'s hand
sourceraw docstring

knockclj

(knock gamestate player-index)

Sets the gamestate's :knocking-player to player-index

Sets the `gamestate`'s `:knocking-player` to `player-index`
sourceraw docstring

new-gamestateclj

(new-gamestate)

Creates the basic skeleton of the gamestate, including a shuffled deck

Creates the basic skeleton of the gamestate, including a shuffled deck
sourceraw docstring

new-roundclj

(new-round gamestate)

Shuffles a new deck, removes players who are no longer in the game, then deals

Shuffles a new deck, removes players who are no longer in the game, then deals
sourceraw docstring

next-playerclj

(next-player gamestate)

Updates :active-player to the next index (or 0 if at end)

Updates `:active-player` to the next index (or 0 if at end)
sourceraw docstring

scoreclj

(score gamestate)

Removes a point from any player for whom [[ev/player-loses-life?]] is true

Removes a point from any player for whom [[ev/player-loses-life?]] is `true`
sourceraw docstring

update-all-hand-pointsclj

(update-all-hand-points gamestate)
(update-all-hand-points gamestate player-index)

Updates :hand-points for all players

Updates `:hand-points` for all players
sourceraw docstring

update-hand-pointsclj

(update-hand-points gamestate player-index)

Updates the player at player-index's :hand-points

Updates the player at `player-index`'s `:hand-points`
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close