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