Skip to content

Commit

Permalink
fix mypy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
wahlp committed Jul 30, 2024
1 parent 4d1ff28 commit 055891c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/main/python/core/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
MAX_DWARF_XP,
)
from helpers import utils
from helpers.datatypes import Cost
from helpers.datatypes import Cost, Status
from helpers.enums import Dwarf, Resource
from helpers.overclock import Overclock

Expand Down Expand Up @@ -470,7 +470,7 @@ def add_cores(self) -> None:
for i in selected:
if i.text(1) == "Unacquired" and i.text(2) in unacquired_ocs:
items_to_add.append(f"{i.parent().text(0)}: {i.text(0)} ({i.text(2)})")
self.state_manager.guid_dict[i.text(2)].status = "Unforged"
self.state_manager.guid_dict[i.text(2)].status = Status.UNFORGED
newly_acquired_ocs.append(i.text(2))

self.state_manager.set_overclocks_to_unforged(newly_acquired_ocs)
Expand Down
10 changes: 5 additions & 5 deletions src/main/python/core/file_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,11 @@ def _get_unforged_overclocks(self, save_data: bytes, start: int):
self.overclocks.append(
Overclock(
category=Category.UNKNOWN,
dwarf="",
dwarf=Dwarf.SCOUT,
weapon="",
name="",
guid=uuid,
status=Status.Unforged,
status=Status.UNFORGED,
cost=Cost(),
)
)
Expand Down Expand Up @@ -260,7 +260,7 @@ def _find_overclocks_start(self, save_data: bytes):

def _add_overclock(self, uuid: str):
overclock_data = self.guid_dict[uuid]
if overclock_data.cost:
if overclock_data.cost and overclock_data.weapon:
self.overclocks.append(
Overclock(
category=overclock_data.category,
Expand All @@ -277,8 +277,8 @@ def _add_overclock(self, uuid: str):
Overclock(
category=overclock_data.category,
dwarf=overclock_data.dwarf,
weapon=None,
cost={},
weapon="",
cost=Cost(),
name=overclock_data.name,
guid=uuid,
status=overclock_data.status,
Expand Down
15 changes: 7 additions & 8 deletions src/main/python/helpers/datatypes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from dataclasses import dataclass, field
from typing import Optional

from helpers.enums import Category, Dwarf, Status

Expand All @@ -8,13 +7,13 @@
class Cost:
"""Crafting cost associated with a forgeable item"""

credits: Optional[int] = 0
bismor: Optional[int] = 0
croppa: Optional[int] = 0
enor: Optional[int] = 0
jadiz: Optional[int] = 0
magnite: Optional[int] = 0
umanite: Optional[int] = 0
credits: int = 0
bismor: int = 0
croppa: int = 0
enor: int = 0
jadiz: int = 0
magnite: int = 0
umanite: int = 0

def __add__(self, other):
newcost = Cost()
Expand Down

0 comments on commit 055891c

Please sign in to comment.