forked from youen/assembly_handbook
25 lines
647 B
Python
25 lines
647 B
Python
class Material:
|
|
def __init__(self, ID, density):
|
|
self.ID = ID
|
|
self.density = density
|
|
|
|
DB = []
|
|
|
|
@staticmethod
|
|
def GetMaterialIDs():
|
|
result = []
|
|
for m in Material.DB:
|
|
result.append(m.ID)
|
|
return result
|
|
|
|
@staticmethod
|
|
def Get(ID):
|
|
for m in Material.DB:
|
|
if m.ID == ID: return m
|
|
return None
|
|
|
|
Material.DB.append(Material('Stainless steel', density = 8.00))
|
|
Material.DB.append(Material('Aluminium', density = 2.71))
|
|
Material.DB.append(Material('Wood (pine)', density = 0.55))
|
|
Material.DB.append(Material('Plywood', density = 0.6))
|