game: add: class: point and segment, add: type docstring

This commit is contained in:
2024-01-21 00:33:30 +01:00
parent 6f8768e149
commit 8da7e09af7
19 changed files with 478 additions and 125 deletions

View File

@ -1,20 +1,15 @@
from .Segment import Segment
class Wall:
def __init__(self, rail_start_x, rail_start_y, rail_stop_x, rail_stop_y) -> None:
self.rail_start_x = rail_start_x
self.rail_start_y = rail_start_y
self.rail_stop_x = rail_stop_x
self.rail_stop_y = rail_stop_y
def __init__(self, rail: Segment) -> None:
self.rail: Segment = rail
def to_dict(self):
def to_dict(self) -> dict[str: dict]:
data = {
"rail_start_x": self.rail_start_x,
"rail_start_y": self.rail_start_y,
"rail_stop_x": self.rail_stop_x,
"rail_stop_y": self.rail_stop_y,
"rail": self.rail.to_dict(),
}
return data