20 lines
503 B
Go
20 lines
503 B
Go
package structs
|
|
|
|
// Player represents a participant in the match.
|
|
type Player struct {
|
|
UserID string `json:"user_id"`
|
|
Username string `json:"username"`
|
|
Index int `json:"index"`
|
|
Metadata map[string]string `json:"metadata,omitempty"`
|
|
}
|
|
|
|
// NewPlayer creates a new player object.
|
|
func NewPlayer(userID, username string, index int) *Player {
|
|
return &Player{
|
|
UserID: userID,
|
|
Username: username,
|
|
Index: index,
|
|
Metadata: make(map[string]string),
|
|
}
|
|
}
|