A couple fixes in items.py

Reformat the items in items.py
Fix the type declaration of Item.background_color
This commit is contained in:
Eryn Wells 2023-02-18 22:57:37 -08:00
parent 30727ccac1
commit 64844d124b

View file

@ -1,7 +1,8 @@
# Eryn Wells <eryn@erynwells.me> # Eryn Wells <eryn@erynwells.me>
from dataclasses import dataclass from dataclasses import dataclass
from typing import Tuple from typing import Optional, Tuple
@dataclass(frozen=True) @dataclass(frozen=True)
class Item: class Item:
@ -27,9 +28,11 @@ class Item:
name: str name: str
description: str description: str
foreground_color: Tuple[int, int, int] foreground_color: Tuple[int, int, int]
background_color: Tuple[int, int, int] = None background_color: Optional[Tuple[int, int, int]] = None
Corpse = Item('%',
name="Corpse", Corpse = Item(
description="The corpse of a once-living being", '%',
foreground_color=(128, 128, 255)) name="Corpse",
description="The corpse of a once-living being",
foreground_color=(128, 128, 255))