Player state
This commit is contained in:
@ -42,5 +42,6 @@ class Settings:
|
||||
board: BoardSettings
|
||||
inacivity_watchdog: InactivityWatchdogSettings
|
||||
ws_server: WSServerSettings
|
||||
purchase_timeout: int = 10 # seconds
|
||||
log_level: int = logging.INFO
|
||||
debug: Optional[DebugSettings] = None
|
||||
|
||||
@ -3,6 +3,8 @@ import uuid
|
||||
from dataclasses import dataclass, field
|
||||
from typing import Optional
|
||||
|
||||
from hopper.enums import PlayerState
|
||||
|
||||
|
||||
@dataclass
|
||||
class Position:
|
||||
@ -20,9 +22,9 @@ class Player:
|
||||
last_seen: datetime.datetime = field(
|
||||
default_factory=lambda: datetime.datetime.now()
|
||||
)
|
||||
state: PlayerState = PlayerState.CREATED
|
||||
active: bool = True
|
||||
can_be_deactivated: bool = True
|
||||
reached_destination: bool = False
|
||||
|
||||
def reset_timeout(self) -> None:
|
||||
self.last_seen = datetime.datetime.now()
|
||||
|
||||
@ -16,7 +16,7 @@ class LayerDto(BaseModel):
|
||||
objects: list[LayerObjectDto]
|
||||
|
||||
class GameDumpPlayerDto(PlayerDto):
|
||||
reached_destination: bool
|
||||
...
|
||||
|
||||
|
||||
class GameDumpDto(BaseModel):
|
||||
|
||||
Reference in New Issue
Block a user