Add type hints to classes

This commit is contained in:
Em (Ethan) Ruszanowski 2024-02-28 17:59:18 -05:00
parent af7451d2eb
commit 3c9741ac89
Signed by: em
GPG key ID: C725D6E571252B96
2 changed files with 6 additions and 4 deletions

2
app.py
View file

@ -3,7 +3,7 @@ import database as db
class Run: class Run:
def __init__(self, moon): def __init__(self, moon: db.Moon):
self.moon: db.Moon = moon self.moon: db.Moon = moon
self.inside_power: int = moon.inside_max_power self.inside_power: int = moon.inside_max_power
self.outside_power: int = moon.outside_max_power self.outside_power: int = moon.outside_max_power

View file

@ -3,8 +3,9 @@ import sqlite3
class Moon: class Moon:
def __init__(self, moon_id, name, risk_level, cost, default_layout, map_size_multiplier, min_scrap, max_scrap, def __init__(self, moon_id: int, name: str, risk_level: str, cost: int, default_layout: str,
outside_max_power, inside_max_power, tier): map_size_multiplier: float, min_scrap: int, max_scrap: int, outside_max_power: int,
inside_max_power: int, tier: str):
self.moon_id: int = moon_id self.moon_id: int = moon_id
self.name: str = name self.name: str = name
self.risk_level: str = risk_level self.risk_level: str = risk_level
@ -19,7 +20,8 @@ class Moon:
class Scrap: class Scrap:
def __init__(self, scrap_id, name, min_value, max_value, weight, conductive, two_handed): def __init__(self, scrap_id: int, name: str, min_value: int,
max_value: int, weight: int, conductive: int, two_handed: int):
self.scrap_id: int = scrap_id self.scrap_id: int = scrap_id
self.name: str = name self.name: str = name
self.min_value: int = min_value self.min_value: int = min_value