mirror of
https://github.com/Threnklyn/dungeon-sheets.git
synced 2026-06-07 05:03:31 +02:00
spells also ordered by level
This commit is contained in:
@@ -63,7 +63,7 @@ class Spell:
|
||||
return s
|
||||
|
||||
def __repr__(self):
|
||||
return '"{:s}"'.format(self.name)
|
||||
return f"{self.level} {self.name}"
|
||||
|
||||
def __eq__(self, other):
|
||||
return (self.name == other.name) and (self.level == other.level)
|
||||
@@ -71,6 +71,9 @@ class Spell:
|
||||
def __hash__(self):
|
||||
return 0
|
||||
|
||||
def __lt__(self, other):
|
||||
return (self.level, self.name) < (other.level, other.name)
|
||||
|
||||
@property
|
||||
def component_string(self):
|
||||
s = f'{", ".join(self.components)}'
|
||||
|
||||
Reference in New Issue
Block a user