Skip to content

Commit

Permalink
CreateNewRoom doc
Browse files Browse the repository at this point in the history
  • Loading branch information
igor-sirotin committed Apr 25, 2024
1 parent e9d6581 commit 4332918
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions game/game.go
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,8 @@ func (g *Game) Deal(input string) (protocol.IssueID, error) {
return issueID, err
}

// CreateNewRoom creates a new room and returns its ID and initial state.
// Use the returned values to JoinRoom later.
func (g *Game) CreateNewRoom() (*protocol.Room, *protocol.State, error) {
room, err := protocol.NewRoom()
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion game/game_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func TestSimpleGame(t *testing.T) {
{ // Deal first vote item
firstVoteItemID, err = game.Deal(firstItemText)
require.NoError(t, err)

state := expectState(t, sub.Ch, nil)
item := checkVoteItems(t, state.Issues)
require.Nil(t, item.Result)
Expand Down

0 comments on commit 4332918

Please sign in to comment.