Erste Version
This commit is contained in:
Executable
+103
@@ -0,0 +1,103 @@
|
||||
import csv
|
||||
import enum
|
||||
import os
|
||||
from typing import Any
|
||||
|
||||
|
||||
class AreaNames(enum.Enum):
|
||||
HEAD = 'Kopf'
|
||||
MIDDLE_TORSO = 'Torso Mitte'
|
||||
RIGHT_TORSO = 'Rechter Torso'
|
||||
LEFT_TORSO = 'Linker Torso'
|
||||
|
||||
|
||||
|
||||
class Cockpit:
|
||||
@property
|
||||
def tonnage(self) -> float:
|
||||
return 3.0
|
||||
|
||||
|
||||
class Reaktor:
|
||||
|
||||
def __init__(self, value: int, tonnage: float):
|
||||
self._tonnage = tonnage
|
||||
self._value = value
|
||||
|
||||
@property
|
||||
def value(self):
|
||||
return self._value
|
||||
|
||||
@property
|
||||
def tonnage(self):
|
||||
return self._tonnage
|
||||
|
||||
|
||||
class Area:
|
||||
_content: dict[str, Any]
|
||||
|
||||
def __init__(self):
|
||||
self.__dict__['_content'] = {}
|
||||
|
||||
def __setattr__(self, key, value):
|
||||
self.__dict__['_content'][key] = value
|
||||
|
||||
def __getattr__(self, item):
|
||||
return self.__dict__['_content'].get(item)
|
||||
|
||||
|
||||
class Gyroskope:
|
||||
def __init__(self, tonnage: float):
|
||||
self._tonnage = tonnage
|
||||
|
||||
@property
|
||||
def tonnage(self) -> float:
|
||||
return self._tonnage
|
||||
|
||||
|
||||
class InnerStructure:
|
||||
|
||||
def __init__(self, tonnage: float, gyroskope: Gyroskope):
|
||||
self._gyroskope = gyroskope
|
||||
self._tonnage = tonnage
|
||||
self._areas = dict()
|
||||
|
||||
@property
|
||||
def tonnage(self) -> float:
|
||||
return self._tonnage
|
||||
|
||||
@property
|
||||
def gyroskope(self) -> Gyroskope:
|
||||
return self._gyroskope
|
||||
|
||||
@property
|
||||
def areas(self) -> dict:
|
||||
return self._areas
|
||||
|
||||
def add_area(self,index: AreaNames, area: Area):
|
||||
self._areas[index] = area
|
||||
|
||||
|
||||
class Mech(object):
|
||||
|
||||
def __init__(self, name: str, tonnage: float, movement_rate: int, inner_structure: InnerStructure):
|
||||
self._movement_rate = movement_rate
|
||||
self._tonnage = tonnage
|
||||
self._name = name
|
||||
self._inner_structure = inner_structure
|
||||
|
||||
@property
|
||||
def name(self) -> str:
|
||||
return self._name
|
||||
|
||||
@property
|
||||
def tonnage(self) -> float:
|
||||
return self._tonnage
|
||||
|
||||
@property
|
||||
def inner_structure(self) -> InnerStructure:
|
||||
return self._inner_structure
|
||||
|
||||
@property
|
||||
def movement_rate(self) -> int:
|
||||
return self._movement_rate
|
||||
Reference in New Issue
Block a user