diff --git a/app/hlds/__init__.py b/app/hlds/__init__.py index 08d9e21..af6145e 100755 --- a/app/hlds/__init__.py +++ b/app/hlds/__init__.py @@ -4,6 +4,7 @@ from glob import glob from os import path, walk from tatsu import parse as tatsu_parse import itertools +from .models import Location # TODO Use proper way to get resources, see https://stackoverflow.com/a/10935674 diff --git a/app/hlds/models.py b/app/hlds/models.py new file mode 100644 index 0000000..b8638d0 --- /dev/null +++ b/app/hlds/models.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python3 + +from typing import List + + +class Option: + def __init__(self, id_, name, description): + self.id = id_ + self.name = name + self.description = description + + +class Choice: + def __init__(self, id_, name, description, options): + self.id = id_ + self.name = name + self.description = description + + self.options: List[Option] = options + + +class Location: + def __init__(self, id_, name, properties, choices, bases): + self.id = id_ + self.name = name + self.properties = properties + + self.choices: List[Choice] = choices + self.bases = bases