built routes for creation of char

This commit is contained in:
2025-11-03 21:42:39 -06:00
parent 6efd3b3aa8
commit 0c83f8cb1a
6 changed files with 188 additions and 10 deletions

View File

@@ -13,24 +13,25 @@ dice = Dice()
progression = DEFAULT_LEVEL_PROGRESSION
def build_char(name:str, origin_story:str, race_id:str, profession_id:str,ability_pathway:str,level:int=1) -> Entity:
def build_char(name:str, origin_story:str, race_id:str, profession_id:str,ability_pathway:str="",level:int=1) -> Entity:
races = RaceRepository()
professions = ProfessionRepository()
race = races.get(race_id)
profession = professions.get(profession_id)
profession.ability_paths
e = Entity(
uuid = str(uuid.uuid4()),
name = name,
origin_story = origin_story,
race =race,
ability_pathway=ability_pathway,
profession = profession
)
if ability_pathway != "":
e.ability_pathway=ability_pathway
# apply race ability scores
for stat, delta in vars(race.ability_scores).items():