mirror of
https://github.com/ethanrusz/scouter.git
synced 2024-11-24 04:27:46 -05:00
Add type hints to classes
This commit is contained in:
parent
9b5e1b2045
commit
af7451d2eb
2 changed files with 21 additions and 21 deletions
6
app.py
6
app.py
|
@ -4,9 +4,9 @@ import database as db
|
||||||
|
|
||||||
class Run:
|
class Run:
|
||||||
def __init__(self, moon):
|
def __init__(self, moon):
|
||||||
self.moon = moon
|
self.moon: db.Moon = moon
|
||||||
self.inside_power = moon.inside_max_power
|
self.inside_power: int = moon.inside_max_power
|
||||||
self.outside_power = moon.outside_max_power
|
self.outside_power: int = moon.outside_max_power
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
|
@ -5,28 +5,28 @@ 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, name, risk_level, cost, default_layout, map_size_multiplier, min_scrap, max_scrap,
|
||||||
outside_max_power, inside_max_power, tier):
|
outside_max_power, inside_max_power, tier):
|
||||||
self.moon_id = moon_id
|
self.moon_id: int = moon_id
|
||||||
self.name = name
|
self.name: str = name
|
||||||
self.risk_level = risk_level
|
self.risk_level: str = risk_level
|
||||||
self.cost = cost
|
self.cost: int = cost
|
||||||
self.default_layout = default_layout,
|
self.default_layout: str = default_layout
|
||||||
self.map_size_multiplier = map_size_multiplier
|
self.map_size_multiplier: float = map_size_multiplier
|
||||||
self.min_scrap = min_scrap
|
self.min_scrap: int = min_scrap
|
||||||
self.max_scrap = max_scrap
|
self.max_scrap: int = max_scrap
|
||||||
self.outside_max_power = outside_max_power
|
self.outside_max_power: int = outside_max_power
|
||||||
self.inside_max_power = inside_max_power
|
self.inside_max_power: int = inside_max_power
|
||||||
self.tier = tier
|
self.tier: str = tier
|
||||||
|
|
||||||
|
|
||||||
class Scrap:
|
class Scrap:
|
||||||
def __init__(self, scrap_id, name, min_value, max_value, weight, conductive, two_handed):
|
def __init__(self, scrap_id, name, min_value, max_value, weight, conductive, two_handed):
|
||||||
self.scrap_id = scrap_id
|
self.scrap_id: int = scrap_id
|
||||||
self.name = name
|
self.name: str = name
|
||||||
self.min_value = min_value
|
self.min_value: int = min_value
|
||||||
self.max_value = max_value
|
self.max_value: int = max_value
|
||||||
self.weight = weight
|
self.weight: int = weight
|
||||||
self.conductive = conductive
|
self.conductive: bool = bool(conductive)
|
||||||
self.two_handed = two_handed
|
self.two_handed: bool = bool(two_handed)
|
||||||
|
|
||||||
|
|
||||||
def get_connection() -> sqlite3.Connection:
|
def get_connection() -> sqlite3.Connection:
|
||||||
|
|
Loading…
Reference in a new issue