WS DTO assign rework
This commit is contained in:
23
hopper/models/ws_dto.py
Normal file
23
hopper/models/ws_dto.py
Normal file
@ -0,0 +1,23 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from pydantic import Field
|
||||
|
||||
from hopper.api.dto import BaseModel, BoardDto, DestinationDto, PlayerDto, PositionDto
|
||||
from hopper.enums import ObjectType
|
||||
|
||||
|
||||
class LayerObjectDto(BaseModel):
|
||||
type: ObjectType = Field(..., alias="type_")
|
||||
position: PositionDto
|
||||
|
||||
|
||||
class LayerDto(BaseModel):
|
||||
name: str
|
||||
objects: list[LayerObjectDto]
|
||||
|
||||
|
||||
class GameStateDto(BaseModel):
|
||||
board: BoardDto
|
||||
destination: DestinationDto
|
||||
players: list[PlayerDto]
|
||||
layers: list[LayerDto]
|
||||
Reference in New Issue
Block a user