Tests: Füge Bauteile in die Zonen hinzu

This commit is contained in:
2025-07-18 16:02:39 +02:00
parent 4d4c6e7794
commit ff0dc0d556
2 changed files with 135 additions and 36 deletions
+59 -13
View File
@@ -1,6 +1,4 @@
import csv
import enum
import os
from typing import Any
@@ -15,26 +13,70 @@ class AreaNames(enum.Enum):
LEFT_ARM = 'Linker Arm'
class ItemTypes(enum.Enum):
COCKPIT = 1
REAKTOR = 2
GYROSKOPE = 3
ACTIVATOR = 4
JOINT = 5
SENSORS = 6
SUSTAINMENT = 7
class Item(object):
def __init__(self, type: ItemTypes):
self._type = type
@property
def type(self):
return self._type
class BigItem(Item):
def __init__(self, type: ItemTypes, tonnage: float):
super().__init__(type)
self._tonnage = tonnage
class Cockpit:
@property
def tonnage(self) -> float:
return 3.0
return self._tonnage
class Reaktor:
class Cockpit(BigItem):
def __init__(self):
super().__init__(ItemTypes.COCKPIT, 3.0)
class Reaktor(BigItem):
def __init__(self, value: int, tonnage: float):
self._tonnage = tonnage
super().__init__(ItemTypes.REAKTOR, tonnage)
self._value = value
@property
def value(self):
return self._value
@property
def tonnage(self):
return self._tonnage
class Activator(Item):
def __init__(self):
super().__init__(ItemTypes.ACTIVATOR)
class Joint(Item):
def __init__(self):
super().__init__(ItemTypes.JOINT)
class Sensors(Item):
def __init__(self):
super().__init__(ItemTypes.SENSORS)
class Sustainment(Item):
def __init__(self):
super().__init__(ItemTypes.SUSTAINMENT)
class Area:
@@ -42,8 +84,9 @@ class Area:
def __init__(self):
self.__dict__['_content'] = {
'children': []
}
'children': [],
'items': {}
}
def __setattr__(self, key, value):
self.__dict__['_content'][key] = value
@@ -80,7 +123,7 @@ class InnerStructure:
def areas(self) -> dict:
return self._areas
def add_area(self,index: AreaNames, area: Area):
def add_area(self, index: AreaNames, area: Area):
self._areas[index] = area
@@ -106,4 +149,7 @@ class Mech(object):
@property
def movement_rate(self) -> int:
return self._movement_rate
return self._movement_rate
def set_item(self, key: tuple, item: Item):
pass