Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Game ¶
type Game struct {
// Percentages is a value from 0 to 1 that represents the current completion of the typing test
Percentages []float64 `json:"percentages"`
Progress []*progress.Model `json:"-"`
// this player's playerID
PlayerID int `json:"player_id"`
// Text is the randomly generated text for the user to type
Text string `json:"-"`
// Typed is the text that the user has typed so far
Typed string `json:"-"`
// Start and end are the start and end time of the typing test
Start time.Time `json:"-"`
// Mistakes is the number of characters that were mistyped by the user
Mistakes int `json:"-"`
// Score is the user's score calculated by correct characters typed
Score float64 `json:"-"`
}
The game model is used for storing the bubbletea application's current state It contains mutliple progress bars, their percentages and is drawn on the screen All clients send their percentages to the central server.
Click to show internal directories.
Click to hide internal directories.