Start models

This commit is contained in:
Midgard 2020-01-25 01:33:23 +01:00
parent 230e336b2b
commit b459dbc9b7
Signed by: midgard
GPG key ID: 511C112F1331BBB4
2 changed files with 30 additions and 0 deletions

View file

@ -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

29
app/hlds/models.py Normal file
View file

@ -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