1
0
Fork 0
taleweave-ai/taleweave/systems/sim/__init__.py

42 lines
838 B
Python
Raw Normal View History

2024-06-22 22:00:46 +00:00
from os import path
from taleweave.systems.generic.logic import load_logic
from .hunger.actions import action_cook, action_eat
2024-06-22 22:54:54 +00:00
from .hygiene.actions import action_wash
2024-06-22 22:00:46 +00:00
from .sleeping.actions import action_sleep
def logic_path(system: str) -> str:
return path.join(".", "taleweave", "systems", "sim", system, "logic.yaml")
SYSTEM_NAMES = [
"hunger",
"hygiene",
"mood",
"sleeping",
2024-05-05 22:45:18 +00:00
]
def init_actions():
return [
# hunger
action_cook,
action_eat,
# hygiene
action_wash,
# sleeping
action_sleep,
]
def init_logic():
2024-06-22 22:00:46 +00:00
systems = []
for system_name in SYSTEM_NAMES:
logic_file = logic_path(system_name)
if path.exists(logic_file):
systems.append(load_logic(logic_file, name_prefix=system_name))
return systems