38 lines
No EOL
768 B
Python
38 lines
No EOL
768 B
Python
import dataclasses
|
|
import enum
|
|
|
|
|
|
class TreasureType(enum.Enum):
|
|
GOLD = 'gold'
|
|
INK = 'ink'
|
|
COG = 'cog'
|
|
DEED = 'deed'
|
|
GEMS = 'bag of gems'
|
|
ART_OBJECT = 'art object'
|
|
CONSUMABLE = 'consumable'
|
|
LIFE = 'life'
|
|
BLESSING = 'blessing'
|
|
NOBILITY_TITLE = 'nobility title'
|
|
RELIC = 'relic'
|
|
|
|
|
|
@dataclasses.dataclass(frozen=True)
|
|
class Treasure:
|
|
amount: int
|
|
treasure_type: TreasureType
|
|
|
|
@property
|
|
def description(self) -> str:
|
|
word = str(self.treasure_type.value)
|
|
word = word.capitalize()
|
|
|
|
return f'{self.amount} {word}'
|
|
|
|
|
|
@dataclasses.dataclass(frozen=True)
|
|
class TreasureHoard:
|
|
revealed: Treasure
|
|
|
|
@property
|
|
def description(self) -> str:
|
|
return f'{self.revealed.description} + ?' |