# Game process

1. Register user
- Store name, password
- Create session token
2. Create table
- Store name
- Create id
- Add player to table
3. Wait for all players
4. Deal first 4 cards
- Store all hand cards, show only 4
5. Collect leger
- Consecutive choice for each player
6. Deal last 4 cards
- Start bidding
7. Bidding
- Choice for each player to match/increase bid
8. Select game
- Highest bidder selects game
- Move to playing
9. Play cards
- Allow shots until certain trick
- Collect completed tricks
- Determine winning card
- End game on last card
10. Finish game
- Count points
- Determine winner
- Back to 4

# Architecture

## Messages to clients over the websocket

### Table info

Contains the general information about the table:
- Player names, Table name

### ConnectionState

Indicates which players are currently online

### GameState

- Current player (either to play a card, state game intention, )
- First player in the round
- Game type (either game, or negotiation stage)

# TODOs

## Make UI for table
- Show players (+ connection state)
- Show played cards
- Show own cards
- Game negotiation

## Updates from server
- Players at table (+ connection state, first/current player)
- Played cards
- Current player
- Game negotiation data
- Remaining cards
- Game results

## API
- Leave table
- Start game
- Send negotiation input
- Send played card
- Send

## Logic
- Shuffle cards
- Cards, Card sets
- Determine playable cards
- Determine win of round
- Rank game types, negotiation

# Roadmap

Version 2:
- Configure game options
- Switch player positions
- Set first player
- Add game costs and player scores
- Introduce "legen" and "schießen"

Version 3:
- Private tables
- Add simple computer player
- Global statistics for players
- Save data persistently
- Table administrator can remove players

# Bugs

- Correctly show available games

