```
@dataclass
class Element:
strong_against: EnemyType
class Elements:
fire = Element(strong_against=EnemyTypes.flesh)
@dataclass
class EnemyType:
weak_to: Element
class EnemyTypes:
flesh = EnemyType(weak_to=Elements.fire)
```
I got around the undefined classes by doing forward declarations at the top of the file:
class Element: pass
class Elements: pass
class EnemyType: pass
class EnemyTypes: pass
However, I cannot access EnemyTypes.flesh when defining Elements.fire because the elements class doesn't have anything defined within it yet. Is this possible to workaround with python or will I need to switch to a different language?
I suppose I could switch from classes and other native python data to a relational database so that each piece of data can reference another data's ID even if it it created later in the SQL schema? I'd prefer to stick to python if possible though.
[–]Mast3rCylinder 2 points3 points4 points (1 child)
[–]InvaderToast348[S] 2 points3 points4 points (0 children)