-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathmodulfactory.py
More file actions
40 lines (33 loc) · 953 Bytes
/
modulfactory.py
File metadata and controls
40 lines (33 loc) · 953 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
from base.modul import Modul
from fisdas.vektor import Vektor
from fisdas.menara_air import MenaraAir
from fisdas.gelombang import Gelombang
from fisdas.gerakpeluru import GerakPeluru
from fisdas.tetapan_pegas import TetapanPegas
from fisdas.glb import GLB
from fisdas.glbb import GLBB
from fisdas.pgb import PGB
class ModulType:
Choice = 1
Modul = 2
# ini buat list modulnya
# langsung masukin sini aja
list_modul = {
TetapanPegas.name : TetapanPegas,
GerakPeluru.name : GerakPeluru,
PGB.name : PGB,
Gelombang.name : Gelombang,
MenaraAir.name : MenaraAir,
GLB.name : GLB,
GLBB.name : GLBB,
Vektor.name : Vektor
}
def get_all_modul() -> list:
return list_modul
def get_type( key : str ):
if issubclass( list_modul[key], Modul ):
return ModulType.Modul
elif list_modul[key] is dict:
return ModulType.Choice
def get_modul( key : str ) -> Modul:
return list_modul.get(key)