48 lines
1.5 KiB
Python
48 lines
1.5 KiB
Python
from typing import Optional
|
|
|
|
from pydantic import Field
|
|
|
|
from common.models.gmodel import Req_WebPacketProtocol, Res_WebPacketProtocol, WebPacketProtocol
|
|
|
|
|
|
class LevelAction(WebPacketProtocol):
|
|
action: str
|
|
name: str
|
|
points: int = Field(description="한 번에 주는 각")
|
|
cap: int = Field(description="하루 한도")
|
|
earned: int = Field(description="오늘 받은 각")
|
|
|
|
|
|
class LevelUnlock(WebPacketProtocol):
|
|
level: int
|
|
key: str
|
|
name: str
|
|
|
|
|
|
class LevelStep(WebPacketProtocol):
|
|
level: int
|
|
name: str
|
|
points: int = Field(description="이 레벨이 되는 각 총량")
|
|
|
|
|
|
class Res_Level(Res_WebPacketProtocol):
|
|
points: int = Field(0, description="모은 각 총량")
|
|
level: int = 1
|
|
name: Optional[str] = None
|
|
floor: int = Field(0, description="지금 레벨이 시작하는 각")
|
|
next_points: Optional[int] = Field(None, description="다음 레벨에 필요한 총량 (마지막 레벨이면 없음)")
|
|
next_name: Optional[str] = None
|
|
streak: int = Field(0, description="이어 출석한 날")
|
|
today: list[LevelAction] = []
|
|
unlocks: list[LevelUnlock] = []
|
|
levels: list[LevelStep] = Field([], description="레벨 전체 (이름·필요한 각)")
|
|
|
|
|
|
class Res_GameStart(Res_WebPacketProtocol):
|
|
play: Optional[str] = Field(None, description="판 시작 표. 라운드를 깰 때 그대로 보낸다")
|
|
|
|
|
|
class Req_GameRound(Req_WebPacketProtocol):
|
|
play: str = Field(max_length=40)
|
|
round: int = Field(description="방금 깬 라운드 (1부터)")
|