game: add: class: point and segment, add: type docstring
This commit is contained in:
17
games/objects/Segment.py
Normal file
17
games/objects/Segment.py
Normal file
@ -0,0 +1,17 @@
|
||||
|
||||
from .Point import Point
|
||||
|
||||
class Segment:
|
||||
|
||||
def __init__(self, start: Point, stop: Point) -> None:
|
||||
self.start: Point = start
|
||||
self.stop: Point = stop
|
||||
|
||||
def to_dict(self):
|
||||
|
||||
data: dict[str: dict] = {
|
||||
"start": self.start.to_dict(),
|
||||
"stop": self.stop.to_dict(),
|
||||
}
|
||||
|
||||
return data
|
Reference in New Issue
Block a user