Files
Patric Stout 82a9749ae7 feat: move hard-coded attributes to YAML patches (#63)
This allows for easier modification of how attributes are calculated, and doesn't require a new dogma-engine for any attribute change.
2024-07-06 11:57:25 +00:00

28 lines
628 B
Python

import glob
import yaml
def load_patches():
effects = []
attributes = []
typeDogma = []
for patch in sorted(glob.glob("patches/*.yaml")):
with open(patch) as fp:
patch = yaml.load(fp, Loader=yaml.CSafeLoader)
for attribute in patch.get("attributes", []):
attributes.append(attribute)
for effect in patch.get("effects", []):
effects.append(effect)
for entry in patch.get("typeDogma", []):
typeDogma.append(entry)
return {
"effects": effects,
"attributes": attributes,
"typeDogma": typeDogma,
}