-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
943295d
commit 27133a3
Showing
5 changed files
with
74 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,30 @@ | ||
defmodule ViralSpiral.Game do | ||
defstruct room: nil, | ||
player_list: nil, | ||
player_map: nil, | ||
scores: nil | ||
|
||
@moduledoc """ | ||
Context for the game. | ||
Rounds and Turns | ||
round = Round.new(players) | ||
round_order = Round.order(round) | ||
During a Round every player gets to draw a card and then take some actions. | ||
When a round begins, we also start a Turn. Within each Round there's a turn that includes everyone except the person who started the turn. | ||
""" | ||
alias ViralSpiral.Game.Room | ||
alias ViralSpiral.Game.State | ||
|
||
@spec create_room(String.t()) :: Room.t() | ||
def create_room(name) do | ||
end | ||
|
||
@spec join_room(String.t(), String.t()) :: Room.t() | ||
def join_room(name, password) do | ||
end | ||
|
||
def pass_card(state, player, to) do | ||
end | ||
|
||
def keep_card(player) do | ||
end | ||
|
||
def discard_card(player) do | ||
end | ||
|
||
def turn_to_fake(player, card) do | ||
end | ||
|
||
def cancel_player(player, target) do | ||
end | ||
|
||
def viral_spiral(player, targets) do | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
defmodule ViralSpiral.Game.State do | ||
defstruct room: nil, | ||
player_list: nil, | ||
player_map: nil, | ||
scores: nil, | ||
round: nil, | ||
turn: nil | ||
|
||
@moduledoc """ | ||
Context for the game. | ||
Rounds and Turns | ||
round = Round.new(players) | ||
round_order = Round.order(round) | ||
During a Round every player gets to draw a card and then take some actions. | ||
When a round begins, we also start a Turn. Within each Round there's a turn that includes everyone except the person who started the turn. | ||
""" | ||
alias ViralSpiral.Game.State | ||
|
||
def set_round(%State{} = game, round) do | ||
%State{game | round: round} | ||
end | ||
|
||
def set_turn(%State{} = game, turn) do | ||
%State{game | turn: turn} | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters