sm-blueprint-lib 0.0.8__py3-none-any.whl → 0.0.10__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,9 +4,19 @@ class SHAPEID:
4
4
  TIMER = "8f7fd0e7-c46e-4944-a414-7ce2437bb30f"
5
5
  SENSOR5 = "20dcd41c-0a11-4668-9b00-97f278ce21af"
6
6
  SWITCH = "7cf717d7-d167-4f2d-a6e7-6b2c70aa3986"
7
+ BUTTON = "1e8d93a4-506b-470d-9ada-9c0a321e2db5"
7
8
  SHAPEID_TO_CLASS = {}
8
9
 
9
10
 
11
+ class COLOR:
12
+ BARRIER_BLOCK_DEFAULT = "CE9E0C"
13
+ BUTTON_DEFAULT = "DF7F01"
14
+ LOGIC_GATE_DEFAULT = "DF7F01"
15
+ SENSOR5_DEFAULT = "DF7F01"
16
+ SWITCH_DEFAULT = "DF7F01"
17
+ TIMER_DEFAULT = "DF7F01"
18
+
19
+
10
20
  class AXIS:
11
21
  DEFAULT_XAXIS = 1
12
22
  DEFAULT_ZAXIS = 3
@@ -1,5 +1,6 @@
1
1
  from .barrierblock import *
2
2
  from .logicgate import *
3
3
  from .sensor import *
4
- # from .switch import * # not finished
4
+ from .switch import *
5
+ from .button import *
5
6
  from .timer import *
@@ -0,0 +1,9 @@
1
+ from dataclasses import dataclass, field
2
+
3
+ from ..bases.parts.baseinteractablepart import BaseInteractablePart
4
+ from ..constants import SHAPEID
5
+
6
+
7
+ @dataclass
8
+ class Button(BaseInteractablePart):
9
+ shapeId: str = field(kw_only=True, default=SHAPEID.BUTTON)
@@ -1,9 +1,9 @@
1
1
  from dataclasses import dataclass, field
2
2
 
3
- from ..bases.parts.baseinteractablepart import BaseInteractablePart
3
+ from ..bases.parts.baselogicpart import BaseLogicPart
4
4
  from ..constants import SHAPEID
5
5
 
6
6
 
7
7
  @dataclass
8
- class Switch(BaseInteractablePart):
9
- raise NotImplemented
8
+ class Switch(BaseLogicPart):
9
+ shapeId: str = field(kw_only=True, default=SHAPEID.SWITCH)
sm_blueprint_lib/utils.py CHANGED
@@ -88,22 +88,27 @@ def connect(_from, _to, *, parallel=True):
88
88
  if isinstance(_from, BaseInteractablePart) and isinstance(_to, BaseInteractablePart):
89
89
  _from.connect(_to)
90
90
  return
91
- if parallel: # Try connect things row-by-row if possible (one to one, one to many, many to many)
92
- if not isinstance(_from, BaseInteractablePart) and not isinstance(_to, BaseInteractablePart): # Assume both are sequence of parts
91
+ # Try connect things row-by-row if possible (one to one, one to many, many to many)
92
+ if parallel:
93
+ # Assume both are sequence of parts
94
+ if not isinstance(_from, BaseInteractablePart) and not isinstance(_to, BaseInteractablePart):
93
95
  for subfrom, subto in zip(_from, _to):
94
96
  connect(subfrom, subto, parallel=parallel)
95
- elif not isinstance(_from, BaseInteractablePart): # Assume _from is a sequence of parts
97
+ # Assume _from is a sequence of parts
98
+ elif not isinstance(_from, BaseInteractablePart):
96
99
  for subfrom in _from:
97
100
  connect(subfrom, _to, parallel=parallel)
98
101
  else: # Assume _to is a sequence of parts
99
102
  for subto in _to:
100
103
  connect(_from, subto, parallel=parallel)
101
104
  else: # Just connect everything to everything lol
102
- if not isinstance(_from, BaseInteractablePart) and not isinstance(_to, BaseInteractablePart): # Assume both are sequence of parts
105
+ # Assume both are sequence of parts
106
+ if not isinstance(_from, BaseInteractablePart) and not isinstance(_to, BaseInteractablePart):
103
107
  for subfrom in _from:
104
108
  for subto in _to:
105
109
  connect(subfrom, subto, parallel=parallel)
106
- elif not isinstance(_from, BaseInteractablePart): # Assume _from is a sequence of parts
110
+ # Assume _from is a sequence of parts
111
+ elif not isinstance(_from, BaseInteractablePart):
107
112
  for subfrom in _from:
108
113
  connect(subfrom, _to, parallel=parallel)
109
114
  else: # Assume _to is a sequence of parts
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sm_blueprint_lib
3
- Version: 0.0.8
3
+ Version: 0.0.10
4
4
  Summary: Scrap Mechanic Library for Blueprint manipulation.
5
5
  Project-URL: Homepage, https://github.com/MauriceTZ/sm_blueprint_lib
6
6
  Project-URL: Issues, https://github.com/MauriceTZ/sm_blueprint_lib/issues
@@ -2,10 +2,10 @@ sm_blueprint_lib/__init__.py,sha256=yTdxFiDVUYCQoW_vakHBbtoQQfHhYkyGlziEO_BIRWE,
2
2
  sm_blueprint_lib/blueprint.py,sha256=fmdB4XKXF-f-iSoq5ckcLdQAX90ftkfvDuOSzHTB_44,1080
3
3
  sm_blueprint_lib/body.py,sha256=sjnS0e1V0bZEhODA6XOxPH2oCt3xrFLQZ47PGhKjD_w,365
4
4
  sm_blueprint_lib/bounds.py,sha256=fH-i8PdlZVg8qlEd3FmIf5mbx4RKhdBOFRAe5cSWWiI,183
5
- sm_blueprint_lib/constants.py,sha256=mll05HrWLGCETzvQlkDPRMBe5HJLAGn5rRkxs5gJ71E,710
5
+ sm_blueprint_lib/constants.py,sha256=iUmfegOo7cFtn8qIRp4JDw8aXJTT53I7gkcFu9h3oMQ,978
6
6
  sm_blueprint_lib/id.py,sha256=5sBHC8qZJnCaizSBs4KGS1dnZHOSdoq5wkuIpuYNRnw,71
7
7
  sm_blueprint_lib/pos.py,sha256=W0yaIg_nYgRqFwSkHlpd7Tfr69XSVwjTY1DfICHXoDo,411
8
- sm_blueprint_lib/utils.py,sha256=oT4s7kpY7-OSFDFiJt48fr7Yp_dBkGz45iOBiwnNcHE,5109
8
+ sm_blueprint_lib/utils.py,sha256=LzsOZfzfpeAgFQczApqtHm3iZ25N9HUWx2Vus95dUqM,5139
9
9
  sm_blueprint_lib/bases/controllers/basecontroller.py,sha256=VFS5J7kGQ8vfWBFjiTPVfXXjyMwJ1VqA3mYuh7Z_8ak,624
10
10
  sm_blueprint_lib/bases/controllers/baselogiccontroller.py,sha256=lDoDt9NKFu01CqyJE09_bq9oDeYK7T-fERO54kd-sFA,290
11
11
  sm_blueprint_lib/bases/controllers/logicgatecontroller.py,sha256=wzw8kdt65Zg6ucNNy47V3-okYod_ea2NH8erfjRu7uw,223
@@ -15,11 +15,12 @@ sm_blueprint_lib/bases/parts/baseboundablepart.py,sha256=jNx_btmkCTksT6FcpHQxEVJ
15
15
  sm_blueprint_lib/bases/parts/baseinteractablepart.py,sha256=VXINrObIr6Y2tFIOI59cB_-625rPwtKZdGDmaa3EgQ8,574
16
16
  sm_blueprint_lib/bases/parts/baselogicpart.py,sha256=al9nLCg8YiLKWd_c_ZQmq9f6sazjF6RNbuGGbYROOps,498
17
17
  sm_blueprint_lib/bases/parts/basepart.py,sha256=hzJBcB4uol65THzEZEGq4d2N9SbK1S4XiMghEuB6cuc,1126
18
- sm_blueprint_lib/parts/__init__.py,sha256=3MW-wlhw2BepJ4bo1_xSAe2DzsfQ1yh-U3UnjWgZm2w,140
18
+ sm_blueprint_lib/parts/__init__.py,sha256=Ij9tismamOFKYyAI-RxcCc97L78XJCxPb6Yto4SPSN8,146
19
19
  sm_blueprint_lib/parts/barrierblock.py,sha256=GPI8ArKKvzO6wnHfBfgmU4Ezcrw9SmtKR0p4mWczYiw,267
20
+ sm_blueprint_lib/parts/button.py,sha256=CtAFyjqXndJq3eNWMRyAC-tVALKVaFVQfDbipILtNnw,263
20
21
  sm_blueprint_lib/parts/logicgate.py,sha256=In7-d-lCx1zJIT-7S0Mh7s32lj7xZ6wxObJMnKJKQQ4,960
21
22
  sm_blueprint_lib/parts/sensor.py,sha256=ZJY5xo0NB6wAwgzS7EO-xgsukXYbwV7ptbGOqLfeBKQ,1008
22
- sm_blueprint_lib/parts/switch.py,sha256=3Yo1xMKV5kWnptgnAA1XR_VU2ft-10EuKR62nzvZ0gI,225
23
+ sm_blueprint_lib/parts/switch.py,sha256=VkPfvux1TeLTZawmYEHMLGnXxk-lqgB6qb2hwpICjms,242
23
24
  sm_blueprint_lib/parts/timer.py,sha256=gw9XaWvP2yW3egT72BGowMu-CZFUY-Hke-Dwg0lsxjM,806
24
25
  sm_blueprint_lib/prebuilds/__init__.py,sha256=iPrsPMiuoluIDvdLGuQmEJ-I11D5qk563ANKr3md1GM,337
25
26
  sm_blueprint_lib/prebuilds/adder.py,sha256=Rq-006N_oD5ExIwQelgfrBKd7g8zFVxk4tj2lZEp82w,1750
@@ -34,7 +35,7 @@ sm_blueprint_lib/prebuilds/register.py,sha256=MAiplmiA2L_VJaxCX2E8QuancnoqvyLY-v
34
35
  sm_blueprint_lib/prebuilds/rom.py,sha256=4dxAaNxRX60kDW17NKew-TJkPB7EMfHuK_zVIm6N-jo,3700
35
36
  sm_blueprint_lib/prebuilds/timer_ram_cached.py,sha256=PG53hDKYS00fur5vazh7iOs2Gm4G_URJLX7d9xWJOe4,19057
36
37
  sm_blueprint_lib/prebuilds/timer_ram_multiclient.py,sha256=NlQeJB6ilEGJDrIOfkFmPWd7afDR_0CUZH7RQpjyA4s,4200
37
- sm_blueprint_lib-0.0.8.dist-info/METADATA,sha256=a8b9VUFkqtRqzOTuWkomOeOb6y6r7VerAgp7ZNuOGs0,3378
38
- sm_blueprint_lib-0.0.8.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
39
- sm_blueprint_lib-0.0.8.dist-info/licenses/LICENSE,sha256=DWhaodryTSEv07KdWbanCMaEujOXYxnj-IEhmgTkOq0,1084
40
- sm_blueprint_lib-0.0.8.dist-info/RECORD,,
38
+ sm_blueprint_lib-0.0.10.dist-info/METADATA,sha256=AaPpuZk3_Ltw5LOE2_AdjtJR8YFD5lVVbL-Nhg7VrHU,3379
39
+ sm_blueprint_lib-0.0.10.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
40
+ sm_blueprint_lib-0.0.10.dist-info/licenses/LICENSE,sha256=DWhaodryTSEv07KdWbanCMaEujOXYxnj-IEhmgTkOq0,1084
41
+ sm_blueprint_lib-0.0.10.dist-info/RECORD,,