-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodels.py
More file actions
33 lines (26 loc) · 897 Bytes
/
models.py
File metadata and controls
33 lines (26 loc) · 897 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from pydantic import BaseModel, Field
from typing import List, Optional, Dict
from graphics.common import DEFAULT_BLOB_COLOR
class SongState(BaseModel):
id: str
title: str
bpm: int
onset: float
start_timestamp: int = Field(..., alias="startTimestamp")
class PlayerState(BaseModel):
user_id: str = Field(..., alias="userId")
username: str
latitude: float
longitude: float
is_main: bool = Field(..., alias="isMain")
status: str
last_mark: Optional[str] = Field(default=None, alias="lastMark")
color: Optional[str] = DEFAULT_BLOB_COLOR
class GameState(BaseModel):
players: List[PlayerState]
song: Optional[SongState] = None
location_title: str = Field(..., alias="locationTitle")
arrow_combination: Optional[List[str]] = Field(
default=None, alias="arrowCombination"
)
scores: Optional[Dict[str, int]] = None