changes spell sorting to alphabetic

This commit is contained in:
matsavage
2021-05-08 18:56:04 +01:00
parent eeef6c3e96
commit 73e26b80d6
2 changed files with 2 additions and 5 deletions
+2 -2
View File
@@ -587,7 +587,7 @@ class Character:
spells |= set(c.spells_known) | set(c.spells_prepared)
if self.race is not None:
spells |= set(self.race.spells_known) | set(self.race.spells_prepared)
return sorted(tuple(spells), key=(lambda x: (x.level, x.name)))
return sorted(tuple(spells), key=(lambda x: (x.name))
@property
def spells_prepared(self):
@@ -598,7 +598,7 @@ class Character:
spells |= set(c.spells_prepared)
if self.race is not None:
spells |= set(self.race.spells_prepared)
return sorted(tuple(spells), key=(lambda x: (x.level, x.name)))
return sorted(tuple(spells), key=(lambda x: x.name))
def set_attrs(self, **attrs):
"""
-3
View File
@@ -71,9 +71,6 @@ 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)}'