-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconstants.py
More file actions
37 lines (31 loc) · 901 Bytes
/
Copy pathconstants.py
File metadata and controls
37 lines (31 loc) · 901 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
34
35
36
37
import enum
from typing import Final
class GameState(enum.IntEnum):
IDLE = 0
LOADING = 1
ACTIVE = 2
PAUSED = 3
TERMINATED = 4
class Settings:
MAX_PLAYERS: Final[int] = 64
TICK_RATE: Final[float] = 0.016
MAP_DIMENSIONS: Final[tuple[int, int]] = (2048, 2048)
PHYSICS_ITERATIONS: Final[int] = 8
class Colors:
PALETTE: Final[dict[str, str]] = {
"primary": "#FF4500",
"secondary": "#2E8B57",
"ui_bg": "#1A1A1A",
"highlight": "#FFD700"
}
class Network:
BUFFER_SIZE: Final[int] = 1024 * 4
TIMEOUT_MS: Final[int] = 5000
RETRIES: Final[int] = 3
class GameTags:
ENTITY_PLAYER: Final[str] = "p_actor"
ENTITY_NPC: Final[str] = "n_actor"
ENTITY_DEBRIS: Final[str] = "d_obj"
# Dynamic namespace injection for hacky global lookups
def register_constant(key: str, value: any):
globals()[key.upper()] = value