This is a full rewrite of the npc generator code to use the
newly-refactored dnd-name-generator code
This commit is contained in:
evilchili 2023-12-02 18:25:45 -08:00
parent 1208616ab3
commit 5ec05fc6d2
2 changed files with 10 additions and 2 deletions

View File

@ -156,6 +156,16 @@ class NPC:
def ancestry(self) -> str: def ancestry(self) -> str:
return self.__class__.__name__ return self.__class__.__name__
@property
def names(self):
if not self._names:
self._names = next(self.name_generator.name(1))
return self._names
@property
def full_name(self):
return self.names.fullname
@property @property
def is_noble(self) -> bool: def is_noble(self) -> bool:
return self._is_noble return self._is_noble

View File

@ -6,7 +6,6 @@ authors = ["evilchili <evilchili@gmail.com>"]
license = "The Unlicense" license = "The Unlicense"
packages = [ packages = [
{ include = 'npc' }, { include = 'npc' },
{ include = 'language' },
] ]
[tool.poetry.dependencies] [tool.poetry.dependencies]
@ -48,4 +47,3 @@ remove-unused-variables = true # remove unused variables
[tool.poetry.scripts] [tool.poetry.scripts]
npc = "npc.cli:app" npc = "npc.cli:app"
language-tool = "language.cli:app"