Files
tetri5/tetris/util.py
2021-06-11 22:48:10 -04:00

23 lines
537 B
Python

import random
import yaml
from typing import Tuple
"""
TODO description
"""
class ConfigurationManager:
CONFIG_FILE_LOCATION = "config.yaml"
configuration = []
@classmethod
def load(cls) -> None:
with open(cls.CONFIG_FILE_LOCATION, "r") as yaml_file:
cls.configuration = yaml.safe_load(yaml_file)
@classmethod
def get(cls, key: str, sub_key: str = None):
if sub_key:
return cls.configuration[key][sub_key]
else:
return cls.configuration[key]