sonolus.py 0.1.2__py3-none-any.whl → 0.1.4__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.

Potentially problematic release.


This version of sonolus.py might be problematic. Click here for more details.

Files changed (72) hide show
  1. sonolus/backend/allocate.py +125 -51
  2. sonolus/backend/blocks.py +756 -756
  3. sonolus/backend/coalesce.py +85 -0
  4. sonolus/backend/constant_evaluation.py +374 -0
  5. sonolus/backend/dead_code.py +80 -0
  6. sonolus/backend/dominance.py +111 -0
  7. sonolus/backend/excepthook.py +37 -37
  8. sonolus/backend/finalize.py +69 -69
  9. sonolus/backend/flow.py +121 -92
  10. sonolus/backend/inlining.py +150 -0
  11. sonolus/backend/ir.py +5 -3
  12. sonolus/backend/liveness.py +173 -0
  13. sonolus/backend/mode.py +24 -24
  14. sonolus/backend/node.py +40 -40
  15. sonolus/backend/ops.py +197 -197
  16. sonolus/backend/optimize.py +37 -9
  17. sonolus/backend/passes.py +52 -6
  18. sonolus/backend/simplify.py +47 -30
  19. sonolus/backend/ssa.py +187 -0
  20. sonolus/backend/utils.py +48 -48
  21. sonolus/backend/visitor.py +892 -880
  22. sonolus/build/cli.py +7 -1
  23. sonolus/build/compile.py +88 -90
  24. sonolus/build/engine.py +55 -5
  25. sonolus/build/level.py +24 -23
  26. sonolus/build/node.py +43 -43
  27. sonolus/script/archetype.py +23 -6
  28. sonolus/script/array.py +2 -2
  29. sonolus/script/bucket.py +191 -191
  30. sonolus/script/callbacks.py +127 -115
  31. sonolus/script/comptime.py +1 -1
  32. sonolus/script/containers.py +23 -0
  33. sonolus/script/debug.py +19 -3
  34. sonolus/script/easing.py +323 -0
  35. sonolus/script/effect.py +131 -131
  36. sonolus/script/engine.py +37 -1
  37. sonolus/script/globals.py +269 -269
  38. sonolus/script/graphics.py +200 -150
  39. sonolus/script/instruction.py +151 -0
  40. sonolus/script/internal/__init__.py +5 -5
  41. sonolus/script/internal/builtin_impls.py +144 -144
  42. sonolus/script/internal/context.py +12 -4
  43. sonolus/script/internal/descriptor.py +17 -17
  44. sonolus/script/internal/introspection.py +14 -14
  45. sonolus/script/internal/native.py +40 -38
  46. sonolus/script/internal/value.py +3 -3
  47. sonolus/script/interval.py +120 -112
  48. sonolus/script/iterator.py +214 -211
  49. sonolus/script/math.py +30 -1
  50. sonolus/script/num.py +1 -1
  51. sonolus/script/options.py +191 -191
  52. sonolus/script/particle.py +157 -157
  53. sonolus/script/pointer.py +30 -30
  54. sonolus/script/{preview.py → print.py} +81 -81
  55. sonolus/script/random.py +14 -0
  56. sonolus/script/range.py +58 -58
  57. sonolus/script/record.py +3 -3
  58. sonolus/script/runtime.py +45 -6
  59. sonolus/script/sprite.py +333 -333
  60. sonolus/script/text.py +407 -407
  61. sonolus/script/timing.py +42 -42
  62. sonolus/script/transform.py +77 -23
  63. sonolus/script/ui.py +160 -160
  64. sonolus/script/vec.py +81 -72
  65. {sonolus_py-0.1.2.dist-info → sonolus_py-0.1.4.dist-info}/METADATA +1 -2
  66. sonolus_py-0.1.4.dist-info/RECORD +84 -0
  67. {sonolus_py-0.1.2.dist-info → sonolus_py-0.1.4.dist-info}/WHEEL +1 -1
  68. {sonolus_py-0.1.2.dist-info → sonolus_py-0.1.4.dist-info}/licenses/LICENSE +21 -21
  69. sonolus/build/defaults.py +0 -32
  70. sonolus/script/icon.py +0 -73
  71. sonolus_py-0.1.2.dist-info/RECORD +0 -76
  72. {sonolus_py-0.1.2.dist-info → sonolus_py-0.1.4.dist-info}/entry_points.txt +0 -0
sonolus/backend/blocks.py CHANGED
@@ -1,756 +1,756 @@
1
- from enum import Enum
2
-
3
-
4
- class BlockData(int):
5
- def __new__(cls, id_: int, readable: set[str], writable: set[str]):
6
- obj = int.__new__(cls, id_)
7
- obj.readable = readable
8
- obj.writable = writable
9
- return obj
10
-
11
-
12
- class BlockEnum(BlockData, Enum):
13
- def __str__(self):
14
- return self.name
15
-
16
-
17
- class TutorialBlock(BlockEnum):
18
- RuntimeEnvironment = (1000, {"preprocess", "navigate", "update"}, {"preprocess"})
19
- RuntimeUpdate = (1001, {"preprocess", "navigate", "update"}, {})
20
- RuntimeSkinTransform = (1002, {"preprocess", "navigate", "update"}, {"preprocess", "navigate", "update"})
21
- RuntimeParticleTransform = (1003, {"preprocess", "navigate", "update"}, {"preprocess", "navigate", "update"})
22
- RuntimeBackground = (1004, {"preprocess", "navigate", "update"}, {"preprocess", "navigate", "update"})
23
- RuntimeUI = (1005, {"preprocess", "navigate", "update"}, {"preprocess"})
24
- RuntimeUIConfiguration = (1006, {"preprocess", "navigate", "update"}, {"preprocess"})
25
- TutorialMemory = (2000, {"preprocess", "navigate", "update"}, {"preprocess", "navigate", "update"})
26
- TutorialData = (2001, {"preprocess", "navigate", "update"}, {"preprocess"})
27
- TutorialInstruction = (2002, {"preprocess", "navigate", "update"}, {"preprocess", "navigate", "update"})
28
- EngineRom = (3000, {"preprocess", "navigate", "update"}, {})
29
- TemporaryMemory = (10000, {"preprocess", "navigate", "update"}, {"preprocess", "navigate", "update"})
30
-
31
-
32
- class PlayBlock(BlockEnum):
33
- RuntimeEnvironment = (
34
- 1000,
35
- {
36
- "preprocess",
37
- "spawnOrder",
38
- "shouldSpawn",
39
- "initialize",
40
- "updateSequential",
41
- "touch",
42
- "updateParallel",
43
- "terminate",
44
- },
45
- {"preprocess"},
46
- )
47
- RuntimeUpdate = (
48
- 1001,
49
- {
50
- "preprocess",
51
- "spawnOrder",
52
- "shouldSpawn",
53
- "initialize",
54
- "updateSequential",
55
- "touch",
56
- "updateParallel",
57
- "terminate",
58
- },
59
- {},
60
- )
61
- RuntimeTouchArray = (
62
- 1002,
63
- {
64
- "preprocess",
65
- "spawnOrder",
66
- "shouldSpawn",
67
- "initialize",
68
- "updateSequential",
69
- "touch",
70
- "updateParallel",
71
- "terminate",
72
- },
73
- {},
74
- )
75
- RuntimeSkinTransform = (
76
- 1003,
77
- {
78
- "preprocess",
79
- "spawnOrder",
80
- "shouldSpawn",
81
- "initialize",
82
- "updateSequential",
83
- "touch",
84
- "updateParallel",
85
- "terminate",
86
- },
87
- {"preprocess", "updateSequential", "touch"},
88
- )
89
- RuntimeParticleTransform = (
90
- 1004,
91
- {
92
- "preprocess",
93
- "spawnOrder",
94
- "shouldSpawn",
95
- "initialize",
96
- "updateSequential",
97
- "touch",
98
- "updateParallel",
99
- "terminate",
100
- },
101
- {"preprocess", "updateSequential", "touch"},
102
- )
103
- RuntimeBackground = (
104
- 1005,
105
- {
106
- "preprocess",
107
- "spawnOrder",
108
- "shouldSpawn",
109
- "initialize",
110
- "updateSequential",
111
- "touch",
112
- "updateParallel",
113
- "terminate",
114
- },
115
- {"preprocess", "updateSequential", "touch"},
116
- )
117
- RuntimeUI = (
118
- 1006,
119
- {
120
- "preprocess",
121
- "spawnOrder",
122
- "shouldSpawn",
123
- "initialize",
124
- "updateSequential",
125
- "touch",
126
- "updateParallel",
127
- "terminate",
128
- },
129
- {"preprocess"},
130
- )
131
- RuntimeUIConfiguration = (
132
- 1007,
133
- {
134
- "preprocess",
135
- "spawnOrder",
136
- "shouldSpawn",
137
- "initialize",
138
- "updateSequential",
139
- "touch",
140
- "updateParallel",
141
- "terminate",
142
- },
143
- {"preprocess"},
144
- )
145
- LevelMemory = (
146
- 2000,
147
- {
148
- "preprocess",
149
- "spawnOrder",
150
- "shouldSpawn",
151
- "initialize",
152
- "updateSequential",
153
- "touch",
154
- "updateParallel",
155
- "terminate",
156
- },
157
- {"preprocess", "updateSequential", "touch"},
158
- )
159
- LevelData = (
160
- 2001,
161
- {
162
- "preprocess",
163
- "spawnOrder",
164
- "shouldSpawn",
165
- "initialize",
166
- "updateSequential",
167
- "touch",
168
- "updateParallel",
169
- "terminate",
170
- },
171
- {"preprocess"},
172
- )
173
- LevelOption = (
174
- 2002,
175
- {
176
- "preprocess",
177
- "spawnOrder",
178
- "shouldSpawn",
179
- "initialize",
180
- "updateSequential",
181
- "touch",
182
- "updateParallel",
183
- "terminate",
184
- },
185
- {},
186
- )
187
- LevelBucket = (
188
- 2003,
189
- {
190
- "preprocess",
191
- "spawnOrder",
192
- "shouldSpawn",
193
- "initialize",
194
- "updateSequential",
195
- "touch",
196
- "updateParallel",
197
- "terminate",
198
- },
199
- {"preprocess"},
200
- )
201
- LevelScore = (
202
- 2004,
203
- {
204
- "preprocess",
205
- "spawnOrder",
206
- "shouldSpawn",
207
- "initialize",
208
- "updateSequential",
209
- "touch",
210
- "updateParallel",
211
- "terminate",
212
- },
213
- {"preprocess"},
214
- )
215
- LevelLife = (
216
- 2005,
217
- {
218
- "preprocess",
219
- "spawnOrder",
220
- "shouldSpawn",
221
- "initialize",
222
- "updateSequential",
223
- "touch",
224
- "updateParallel",
225
- "terminate",
226
- },
227
- {"preprocess"},
228
- )
229
- EngineRom = (
230
- 3000,
231
- {
232
- "preprocess",
233
- "spawnOrder",
234
- "shouldSpawn",
235
- "initialize",
236
- "updateSequential",
237
- "touch",
238
- "updateParallel",
239
- "terminate",
240
- },
241
- {},
242
- )
243
- EntityMemory = (
244
- 4000,
245
- {
246
- "preprocess",
247
- "spawnOrder",
248
- "shouldSpawn",
249
- "initialize",
250
- "updateSequential",
251
- "touch",
252
- "updateParallel",
253
- "terminate",
254
- },
255
- {
256
- "preprocess",
257
- "spawnOrder",
258
- "shouldSpawn",
259
- "initialize",
260
- "updateSequential",
261
- "touch",
262
- "updateParallel",
263
- "terminate",
264
- },
265
- )
266
- EntityData = (
267
- 4001,
268
- {
269
- "preprocess",
270
- "spawnOrder",
271
- "shouldSpawn",
272
- "initialize",
273
- "updateSequential",
274
- "touch",
275
- "updateParallel",
276
- "terminate",
277
- },
278
- {"preprocess"},
279
- )
280
- EntitySharedMemory = (
281
- 4002,
282
- {
283
- "preprocess",
284
- "spawnOrder",
285
- "shouldSpawn",
286
- "initialize",
287
- "updateSequential",
288
- "touch",
289
- "updateParallel",
290
- "terminate",
291
- },
292
- {"preprocess", "updateSequential", "touch"},
293
- )
294
- EntityInfo = (
295
- 4003,
296
- {
297
- "preprocess",
298
- "spawnOrder",
299
- "shouldSpawn",
300
- "initialize",
301
- "updateSequential",
302
- "touch",
303
- "updateParallel",
304
- "terminate",
305
- },
306
- {},
307
- )
308
- EntityDespawn = (
309
- 4004,
310
- {
311
- "preprocess",
312
- "spawnOrder",
313
- "shouldSpawn",
314
- "initialize",
315
- "updateSequential",
316
- "touch",
317
- "updateParallel",
318
- "terminate",
319
- },
320
- {
321
- "preprocess",
322
- "spawnOrder",
323
- "shouldSpawn",
324
- "initialize",
325
- "updateSequential",
326
- "touch",
327
- "updateParallel",
328
- "terminate",
329
- },
330
- )
331
- EntityInput = (
332
- 4005,
333
- {
334
- "preprocess",
335
- "spawnOrder",
336
- "shouldSpawn",
337
- "initialize",
338
- "updateSequential",
339
- "touch",
340
- "updateParallel",
341
- "terminate",
342
- },
343
- {
344
- "preprocess",
345
- "spawnOrder",
346
- "shouldSpawn",
347
- "initialize",
348
- "updateSequential",
349
- "touch",
350
- "updateParallel",
351
- "terminate",
352
- },
353
- )
354
- EntityDataArray = (
355
- 4101,
356
- {
357
- "preprocess",
358
- "spawnOrder",
359
- "shouldSpawn",
360
- "initialize",
361
- "updateSequential",
362
- "touch",
363
- "updateParallel",
364
- "terminate",
365
- },
366
- {"preprocess"},
367
- )
368
- EntitySharedMemoryArray = (
369
- 4102,
370
- {
371
- "preprocess",
372
- "spawnOrder",
373
- "shouldSpawn",
374
- "initialize",
375
- "updateSequential",
376
- "touch",
377
- "updateParallel",
378
- "terminate",
379
- },
380
- {"preprocess", "updateSequential", "touch"},
381
- )
382
- EntityInfoArray = (
383
- 4103,
384
- {
385
- "preprocess",
386
- "spawnOrder",
387
- "shouldSpawn",
388
- "initialize",
389
- "updateSequential",
390
- "touch",
391
- "updateParallel",
392
- "terminate",
393
- },
394
- {},
395
- )
396
- ArchetypeLife = (
397
- 5000,
398
- {
399
- "preprocess",
400
- "spawnOrder",
401
- "shouldSpawn",
402
- "initialize",
403
- "updateSequential",
404
- "touch",
405
- "updateParallel",
406
- "terminate",
407
- },
408
- {"preprocess"},
409
- )
410
- TemporaryMemory = (
411
- 10000,
412
- {
413
- "preprocess",
414
- "spawnOrder",
415
- "shouldSpawn",
416
- "initialize",
417
- "updateSequential",
418
- "touch",
419
- "updateParallel",
420
- "terminate",
421
- },
422
- {
423
- "preprocess",
424
- "spawnOrder",
425
- "shouldSpawn",
426
- "initialize",
427
- "updateSequential",
428
- "touch",
429
- "updateParallel",
430
- "terminate",
431
- },
432
- )
433
-
434
-
435
- class PreviewBlock(BlockEnum):
436
- RuntimeEnvironment = (1000, {"preprocess", "render"}, {"preprocess"})
437
- RuntimeCanvas = (1001, {"preprocess", "render"}, {"preprocess"})
438
- RuntimeSkinTransform = (1002, {"preprocess", "render"}, {"preprocess"})
439
- RuntimeUI = (1003, {"preprocess", "render"}, {"preprocess"})
440
- RuntimeUIConfiguration = (1004, {"preprocess", "render"}, {"preprocess"})
441
- PreviewData = (2000, {"preprocess", "render"}, {"preprocess"})
442
- PreviewOption = (2001, {"preprocess", "render"}, {})
443
- EngineRom = (3000, {"preprocess", "render"}, {})
444
- EntityData = (4000, {"preprocess", "render"}, {"preprocess"})
445
- EntitySharedMemory = (4001, {"preprocess", "render"}, {"preprocess"})
446
- EntityInfo = (4002, {"preprocess", "render"}, {})
447
- EntityDataArray = (4100, {"preprocess", "render"}, {"preprocess"})
448
- EntitySharedMemoryArray = (4101, {"preprocess", "render"}, {"preprocess"})
449
- EntityInfoArray = (4102, {"preprocess", "render"}, {})
450
- TemporaryMemory = (10000, {"preprocess", "render"}, {"preprocess", "render"})
451
-
452
-
453
- class WatchBlock(BlockEnum):
454
- RuntimeEnvironment = (
455
- 1000,
456
- {
457
- "preprocess",
458
- "spawnTime",
459
- "despawnTime",
460
- "initialize",
461
- "updateSequential",
462
- "updateParallel",
463
- "terminate",
464
- "updateSpawn",
465
- },
466
- {"preprocess"},
467
- )
468
- RuntimeUpdate = (
469
- 1001,
470
- {
471
- "preprocess",
472
- "spawnTime",
473
- "despawnTime",
474
- "initialize",
475
- "updateSequential",
476
- "updateParallel",
477
- "terminate",
478
- "updateSpawn",
479
- },
480
- {},
481
- )
482
- RuntimeSkinTransform = (
483
- 1002,
484
- {
485
- "preprocess",
486
- "spawnTime",
487
- "despawnTime",
488
- "initialize",
489
- "updateSequential",
490
- "updateParallel",
491
- "terminate",
492
- "updateSpawn",
493
- },
494
- {"preprocess", "updateSequential"},
495
- )
496
- RuntimeParticleTransform = (
497
- 1003,
498
- {
499
- "preprocess",
500
- "spawnTime",
501
- "despawnTime",
502
- "initialize",
503
- "updateSequential",
504
- "updateParallel",
505
- "terminate",
506
- "updateSpawn",
507
- },
508
- {"preprocess", "updateSequential"},
509
- )
510
- RuntimeBackground = (
511
- 1004,
512
- {
513
- "preprocess",
514
- "spawnTime",
515
- "despawnTime",
516
- "initialize",
517
- "updateSequential",
518
- "updateParallel",
519
- "terminate",
520
- "updateSpawn",
521
- },
522
- {"preprocess", "updateSequential"},
523
- )
524
- RuntimeUI = (
525
- 1005,
526
- {
527
- "preprocess",
528
- "spawnTime",
529
- "despawnTime",
530
- "initialize",
531
- "updateSequential",
532
- "updateParallel",
533
- "terminate",
534
- "updateSpawn",
535
- },
536
- {"preprocess"},
537
- )
538
- RuntimeUIConfiguration = (
539
- 1006,
540
- {
541
- "preprocess",
542
- "spawnTime",
543
- "despawnTime",
544
- "initialize",
545
- "updateSequential",
546
- "updateParallel",
547
- "terminate",
548
- "updateSpawn",
549
- },
550
- {"preprocess"},
551
- )
552
- LevelMemory = (
553
- 2000,
554
- {
555
- "preprocess",
556
- "spawnTime",
557
- "despawnTime",
558
- "initialize",
559
- "updateSequential",
560
- "updateParallel",
561
- "terminate",
562
- "updateSpawn",
563
- },
564
- {"preprocess", "updateSequential"},
565
- )
566
- LevelData = (
567
- 2001,
568
- {
569
- "preprocess",
570
- "spawnTime",
571
- "despawnTime",
572
- "initialize",
573
- "updateSequential",
574
- "updateParallel",
575
- "terminate",
576
- "updateSpawn",
577
- },
578
- {"preprocess"},
579
- )
580
- LevelOption = (
581
- 2002,
582
- {
583
- "preprocess",
584
- "spawnTime",
585
- "despawnTime",
586
- "initialize",
587
- "updateSequential",
588
- "updateParallel",
589
- "terminate",
590
- "updateSpawn",
591
- },
592
- {},
593
- )
594
- LevelBucket = (
595
- 2003,
596
- {
597
- "preprocess",
598
- "spawnTime",
599
- "despawnTime",
600
- "initialize",
601
- "updateSequential",
602
- "updateParallel",
603
- "terminate",
604
- "updateSpawn",
605
- },
606
- {"preprocess"},
607
- )
608
- LevelScore = (
609
- 2004,
610
- {
611
- "preprocess",
612
- "spawnTime",
613
- "despawnTime",
614
- "initialize",
615
- "updateSequential",
616
- "updateParallel",
617
- "terminate",
618
- "updateSpawn",
619
- },
620
- {"preprocess"},
621
- )
622
- LevelLife = (
623
- 2005,
624
- {
625
- "preprocess",
626
- "spawnTime",
627
- "despawnTime",
628
- "initialize",
629
- "updateSequential",
630
- "updateParallel",
631
- "terminate",
632
- "updateSpawn",
633
- },
634
- {"preprocess"},
635
- )
636
- EngineRom = (
637
- 3000,
638
- {
639
- "preprocess",
640
- "spawnTime",
641
- "despawnTime",
642
- "initialize",
643
- "updateSequential",
644
- "updateParallel",
645
- "terminate",
646
- "updateSpawn",
647
- },
648
- {},
649
- )
650
- EntityMemory = (
651
- 4000,
652
- {"preprocess", "spawnTime", "despawnTime", "initialize", "updateSequential", "updateParallel", "terminate"},
653
- {"preprocess", "spawnTime", "despawnTime", "initialize", "updateSequential", "updateParallel", "terminate"},
654
- )
655
- EntityData = (
656
- 4001,
657
- {"preprocess", "spawnTime", "despawnTime", "initialize", "updateSequential", "updateParallel", "terminate"},
658
- {"preprocess"},
659
- )
660
- EntitySharedMemory = (
661
- 4002,
662
- {"preprocess", "spawnTime", "despawnTime", "initialize", "updateSequential", "updateParallel", "terminate"},
663
- {"preprocess", "updateSequential"},
664
- )
665
- EntityInfo = (
666
- 4003,
667
- {"preprocess", "spawnTime", "despawnTime", "initialize", "updateSequential", "updateParallel", "terminate"},
668
- {},
669
- )
670
- EntityInput = (
671
- 4004,
672
- {"preprocess", "spawnTime", "despawnTime", "initialize", "updateSequential", "updateParallel", "terminate"},
673
- {"preprocess"},
674
- )
675
- EntityDataArray = (
676
- 4101,
677
- {
678
- "preprocess",
679
- "spawnTime",
680
- "despawnTime",
681
- "initialize",
682
- "updateSequential",
683
- "updateParallel",
684
- "terminate",
685
- "updateSpawn",
686
- },
687
- {"preprocess"},
688
- )
689
- EntitySharedMemoryArray = (
690
- 4102,
691
- {
692
- "preprocess",
693
- "spawnTime",
694
- "despawnTime",
695
- "initialize",
696
- "updateSequential",
697
- "updateParallel",
698
- "terminate",
699
- "updateSpawn",
700
- },
701
- {"preprocess", "updateSequential"},
702
- )
703
- EntityInfoArray = (
704
- 4103,
705
- {
706
- "preprocess",
707
- "spawnTime",
708
- "despawnTime",
709
- "initialize",
710
- "updateSequential",
711
- "updateParallel",
712
- "terminate",
713
- "updateSpawn",
714
- },
715
- {},
716
- )
717
- ArchetypeLife = (
718
- 5000,
719
- {
720
- "preprocess",
721
- "spawnTime",
722
- "despawnTime",
723
- "initialize",
724
- "updateSequential",
725
- "updateParallel",
726
- "terminate",
727
- "updateSpawn",
728
- },
729
- {"preprocess"},
730
- )
731
- TemporaryMemory = (
732
- 10000,
733
- {
734
- "preprocess",
735
- "spawnTime",
736
- "despawnTime",
737
- "initialize",
738
- "updateSequential",
739
- "updateParallel",
740
- "terminate",
741
- "updateSpawn",
742
- },
743
- {
744
- "preprocess",
745
- "spawnTime",
746
- "despawnTime",
747
- "initialize",
748
- "updateSequential",
749
- "updateParallel",
750
- "terminate",
751
- "updateSpawn",
752
- },
753
- )
754
-
755
-
756
- type Block = TutorialBlock | PlayBlock | PreviewBlock | WatchBlock
1
+ from enum import Enum
2
+
3
+
4
+ class BlockData(int):
5
+ def __new__(cls, id_: int, readable: set[str], writable: set[str]):
6
+ obj = int.__new__(cls, id_)
7
+ obj.readable = readable
8
+ obj.writable = writable
9
+ return obj
10
+
11
+
12
+ class BlockEnum(BlockData, Enum):
13
+ def __str__(self):
14
+ return self.name
15
+
16
+
17
+ class TutorialBlock(BlockEnum):
18
+ RuntimeEnvironment = (1000, {"preprocess", "navigate", "update"}, {"preprocess"})
19
+ RuntimeUpdate = (1001, {"preprocess", "navigate", "update"}, {})
20
+ RuntimeSkinTransform = (1002, {"preprocess", "navigate", "update"}, {"preprocess", "navigate", "update"})
21
+ RuntimeParticleTransform = (1003, {"preprocess", "navigate", "update"}, {"preprocess", "navigate", "update"})
22
+ RuntimeBackground = (1004, {"preprocess", "navigate", "update"}, {"preprocess", "navigate", "update"})
23
+ RuntimeUI = (1005, {"preprocess", "navigate", "update"}, {"preprocess"})
24
+ RuntimeUIConfiguration = (1006, {"preprocess", "navigate", "update"}, {"preprocess"})
25
+ TutorialMemory = (2000, {"preprocess", "navigate", "update"}, {"preprocess", "navigate", "update"})
26
+ TutorialData = (2001, {"preprocess", "navigate", "update"}, {"preprocess"})
27
+ TutorialInstruction = (2002, {"preprocess", "navigate", "update"}, {"preprocess", "navigate", "update"})
28
+ EngineRom = (3000, {"preprocess", "navigate", "update"}, {})
29
+ TemporaryMemory = (10000, {"preprocess", "navigate", "update"}, {"preprocess", "navigate", "update"})
30
+
31
+
32
+ class PlayBlock(BlockEnum):
33
+ RuntimeEnvironment = (
34
+ 1000,
35
+ {
36
+ "preprocess",
37
+ "spawnOrder",
38
+ "shouldSpawn",
39
+ "initialize",
40
+ "updateSequential",
41
+ "touch",
42
+ "updateParallel",
43
+ "terminate",
44
+ },
45
+ {"preprocess"},
46
+ )
47
+ RuntimeUpdate = (
48
+ 1001,
49
+ {
50
+ "preprocess",
51
+ "spawnOrder",
52
+ "shouldSpawn",
53
+ "initialize",
54
+ "updateSequential",
55
+ "touch",
56
+ "updateParallel",
57
+ "terminate",
58
+ },
59
+ {},
60
+ )
61
+ RuntimeTouchArray = (
62
+ 1002,
63
+ {
64
+ "preprocess",
65
+ "spawnOrder",
66
+ "shouldSpawn",
67
+ "initialize",
68
+ "updateSequential",
69
+ "touch",
70
+ "updateParallel",
71
+ "terminate",
72
+ },
73
+ {},
74
+ )
75
+ RuntimeSkinTransform = (
76
+ 1003,
77
+ {
78
+ "preprocess",
79
+ "spawnOrder",
80
+ "shouldSpawn",
81
+ "initialize",
82
+ "updateSequential",
83
+ "touch",
84
+ "updateParallel",
85
+ "terminate",
86
+ },
87
+ {"preprocess", "updateSequential", "touch"},
88
+ )
89
+ RuntimeParticleTransform = (
90
+ 1004,
91
+ {
92
+ "preprocess",
93
+ "spawnOrder",
94
+ "shouldSpawn",
95
+ "initialize",
96
+ "updateSequential",
97
+ "touch",
98
+ "updateParallel",
99
+ "terminate",
100
+ },
101
+ {"preprocess", "updateSequential", "touch"},
102
+ )
103
+ RuntimeBackground = (
104
+ 1005,
105
+ {
106
+ "preprocess",
107
+ "spawnOrder",
108
+ "shouldSpawn",
109
+ "initialize",
110
+ "updateSequential",
111
+ "touch",
112
+ "updateParallel",
113
+ "terminate",
114
+ },
115
+ {"preprocess", "updateSequential", "touch"},
116
+ )
117
+ RuntimeUI = (
118
+ 1006,
119
+ {
120
+ "preprocess",
121
+ "spawnOrder",
122
+ "shouldSpawn",
123
+ "initialize",
124
+ "updateSequential",
125
+ "touch",
126
+ "updateParallel",
127
+ "terminate",
128
+ },
129
+ {"preprocess"},
130
+ )
131
+ RuntimeUIConfiguration = (
132
+ 1007,
133
+ {
134
+ "preprocess",
135
+ "spawnOrder",
136
+ "shouldSpawn",
137
+ "initialize",
138
+ "updateSequential",
139
+ "touch",
140
+ "updateParallel",
141
+ "terminate",
142
+ },
143
+ {"preprocess"},
144
+ )
145
+ LevelMemory = (
146
+ 2000,
147
+ {
148
+ "preprocess",
149
+ "spawnOrder",
150
+ "shouldSpawn",
151
+ "initialize",
152
+ "updateSequential",
153
+ "touch",
154
+ "updateParallel",
155
+ "terminate",
156
+ },
157
+ {"preprocess", "updateSequential", "touch"},
158
+ )
159
+ LevelData = (
160
+ 2001,
161
+ {
162
+ "preprocess",
163
+ "spawnOrder",
164
+ "shouldSpawn",
165
+ "initialize",
166
+ "updateSequential",
167
+ "touch",
168
+ "updateParallel",
169
+ "terminate",
170
+ },
171
+ {"preprocess"},
172
+ )
173
+ LevelOption = (
174
+ 2002,
175
+ {
176
+ "preprocess",
177
+ "spawnOrder",
178
+ "shouldSpawn",
179
+ "initialize",
180
+ "updateSequential",
181
+ "touch",
182
+ "updateParallel",
183
+ "terminate",
184
+ },
185
+ {},
186
+ )
187
+ LevelBucket = (
188
+ 2003,
189
+ {
190
+ "preprocess",
191
+ "spawnOrder",
192
+ "shouldSpawn",
193
+ "initialize",
194
+ "updateSequential",
195
+ "touch",
196
+ "updateParallel",
197
+ "terminate",
198
+ },
199
+ {"preprocess"},
200
+ )
201
+ LevelScore = (
202
+ 2004,
203
+ {
204
+ "preprocess",
205
+ "spawnOrder",
206
+ "shouldSpawn",
207
+ "initialize",
208
+ "updateSequential",
209
+ "touch",
210
+ "updateParallel",
211
+ "terminate",
212
+ },
213
+ {"preprocess"},
214
+ )
215
+ LevelLife = (
216
+ 2005,
217
+ {
218
+ "preprocess",
219
+ "spawnOrder",
220
+ "shouldSpawn",
221
+ "initialize",
222
+ "updateSequential",
223
+ "touch",
224
+ "updateParallel",
225
+ "terminate",
226
+ },
227
+ {"preprocess"},
228
+ )
229
+ EngineRom = (
230
+ 3000,
231
+ {
232
+ "preprocess",
233
+ "spawnOrder",
234
+ "shouldSpawn",
235
+ "initialize",
236
+ "updateSequential",
237
+ "touch",
238
+ "updateParallel",
239
+ "terminate",
240
+ },
241
+ {},
242
+ )
243
+ EntityMemory = (
244
+ 4000,
245
+ {
246
+ "preprocess",
247
+ "spawnOrder",
248
+ "shouldSpawn",
249
+ "initialize",
250
+ "updateSequential",
251
+ "touch",
252
+ "updateParallel",
253
+ "terminate",
254
+ },
255
+ {
256
+ "preprocess",
257
+ "spawnOrder",
258
+ "shouldSpawn",
259
+ "initialize",
260
+ "updateSequential",
261
+ "touch",
262
+ "updateParallel",
263
+ "terminate",
264
+ },
265
+ )
266
+ EntityData = (
267
+ 4001,
268
+ {
269
+ "preprocess",
270
+ "spawnOrder",
271
+ "shouldSpawn",
272
+ "initialize",
273
+ "updateSequential",
274
+ "touch",
275
+ "updateParallel",
276
+ "terminate",
277
+ },
278
+ {"preprocess"},
279
+ )
280
+ EntitySharedMemory = (
281
+ 4002,
282
+ {
283
+ "preprocess",
284
+ "spawnOrder",
285
+ "shouldSpawn",
286
+ "initialize",
287
+ "updateSequential",
288
+ "touch",
289
+ "updateParallel",
290
+ "terminate",
291
+ },
292
+ {"preprocess", "updateSequential", "touch"},
293
+ )
294
+ EntityInfo = (
295
+ 4003,
296
+ {
297
+ "preprocess",
298
+ "spawnOrder",
299
+ "shouldSpawn",
300
+ "initialize",
301
+ "updateSequential",
302
+ "touch",
303
+ "updateParallel",
304
+ "terminate",
305
+ },
306
+ {},
307
+ )
308
+ EntityDespawn = (
309
+ 4004,
310
+ {
311
+ "preprocess",
312
+ "spawnOrder",
313
+ "shouldSpawn",
314
+ "initialize",
315
+ "updateSequential",
316
+ "touch",
317
+ "updateParallel",
318
+ "terminate",
319
+ },
320
+ {
321
+ "preprocess",
322
+ "spawnOrder",
323
+ "shouldSpawn",
324
+ "initialize",
325
+ "updateSequential",
326
+ "touch",
327
+ "updateParallel",
328
+ "terminate",
329
+ },
330
+ )
331
+ EntityInput = (
332
+ 4005,
333
+ {
334
+ "preprocess",
335
+ "spawnOrder",
336
+ "shouldSpawn",
337
+ "initialize",
338
+ "updateSequential",
339
+ "touch",
340
+ "updateParallel",
341
+ "terminate",
342
+ },
343
+ {
344
+ "preprocess",
345
+ "spawnOrder",
346
+ "shouldSpawn",
347
+ "initialize",
348
+ "updateSequential",
349
+ "touch",
350
+ "updateParallel",
351
+ "terminate",
352
+ },
353
+ )
354
+ EntityDataArray = (
355
+ 4101,
356
+ {
357
+ "preprocess",
358
+ "spawnOrder",
359
+ "shouldSpawn",
360
+ "initialize",
361
+ "updateSequential",
362
+ "touch",
363
+ "updateParallel",
364
+ "terminate",
365
+ },
366
+ {"preprocess"},
367
+ )
368
+ EntitySharedMemoryArray = (
369
+ 4102,
370
+ {
371
+ "preprocess",
372
+ "spawnOrder",
373
+ "shouldSpawn",
374
+ "initialize",
375
+ "updateSequential",
376
+ "touch",
377
+ "updateParallel",
378
+ "terminate",
379
+ },
380
+ {"preprocess", "updateSequential", "touch"},
381
+ )
382
+ EntityInfoArray = (
383
+ 4103,
384
+ {
385
+ "preprocess",
386
+ "spawnOrder",
387
+ "shouldSpawn",
388
+ "initialize",
389
+ "updateSequential",
390
+ "touch",
391
+ "updateParallel",
392
+ "terminate",
393
+ },
394
+ {},
395
+ )
396
+ ArchetypeLife = (
397
+ 5000,
398
+ {
399
+ "preprocess",
400
+ "spawnOrder",
401
+ "shouldSpawn",
402
+ "initialize",
403
+ "updateSequential",
404
+ "touch",
405
+ "updateParallel",
406
+ "terminate",
407
+ },
408
+ {"preprocess"},
409
+ )
410
+ TemporaryMemory = (
411
+ 10000,
412
+ {
413
+ "preprocess",
414
+ "spawnOrder",
415
+ "shouldSpawn",
416
+ "initialize",
417
+ "updateSequential",
418
+ "touch",
419
+ "updateParallel",
420
+ "terminate",
421
+ },
422
+ {
423
+ "preprocess",
424
+ "spawnOrder",
425
+ "shouldSpawn",
426
+ "initialize",
427
+ "updateSequential",
428
+ "touch",
429
+ "updateParallel",
430
+ "terminate",
431
+ },
432
+ )
433
+
434
+
435
+ class PreviewBlock(BlockEnum):
436
+ RuntimeEnvironment = (1000, {"preprocess", "render"}, {"preprocess"})
437
+ RuntimeCanvas = (1001, {"preprocess", "render"}, {"preprocess"})
438
+ RuntimeSkinTransform = (1002, {"preprocess", "render"}, {"preprocess"})
439
+ RuntimeUI = (1003, {"preprocess", "render"}, {"preprocess"})
440
+ RuntimeUIConfiguration = (1004, {"preprocess", "render"}, {"preprocess"})
441
+ PreviewData = (2000, {"preprocess", "render"}, {"preprocess"})
442
+ PreviewOption = (2001, {"preprocess", "render"}, {})
443
+ EngineRom = (3000, {"preprocess", "render"}, {})
444
+ EntityData = (4000, {"preprocess", "render"}, {"preprocess"})
445
+ EntitySharedMemory = (4001, {"preprocess", "render"}, {"preprocess"})
446
+ EntityInfo = (4002, {"preprocess", "render"}, {})
447
+ EntityDataArray = (4100, {"preprocess", "render"}, {"preprocess"})
448
+ EntitySharedMemoryArray = (4101, {"preprocess", "render"}, {"preprocess"})
449
+ EntityInfoArray = (4102, {"preprocess", "render"}, {})
450
+ TemporaryMemory = (10000, {"preprocess", "render"}, {"preprocess", "render"})
451
+
452
+
453
+ class WatchBlock(BlockEnum):
454
+ RuntimeEnvironment = (
455
+ 1000,
456
+ {
457
+ "preprocess",
458
+ "spawnTime",
459
+ "despawnTime",
460
+ "initialize",
461
+ "updateSequential",
462
+ "updateParallel",
463
+ "terminate",
464
+ "updateSpawn",
465
+ },
466
+ {"preprocess"},
467
+ )
468
+ RuntimeUpdate = (
469
+ 1001,
470
+ {
471
+ "preprocess",
472
+ "spawnTime",
473
+ "despawnTime",
474
+ "initialize",
475
+ "updateSequential",
476
+ "updateParallel",
477
+ "terminate",
478
+ "updateSpawn",
479
+ },
480
+ {},
481
+ )
482
+ RuntimeSkinTransform = (
483
+ 1002,
484
+ {
485
+ "preprocess",
486
+ "spawnTime",
487
+ "despawnTime",
488
+ "initialize",
489
+ "updateSequential",
490
+ "updateParallel",
491
+ "terminate",
492
+ "updateSpawn",
493
+ },
494
+ {"preprocess", "updateSequential"},
495
+ )
496
+ RuntimeParticleTransform = (
497
+ 1003,
498
+ {
499
+ "preprocess",
500
+ "spawnTime",
501
+ "despawnTime",
502
+ "initialize",
503
+ "updateSequential",
504
+ "updateParallel",
505
+ "terminate",
506
+ "updateSpawn",
507
+ },
508
+ {"preprocess", "updateSequential"},
509
+ )
510
+ RuntimeBackground = (
511
+ 1004,
512
+ {
513
+ "preprocess",
514
+ "spawnTime",
515
+ "despawnTime",
516
+ "initialize",
517
+ "updateSequential",
518
+ "updateParallel",
519
+ "terminate",
520
+ "updateSpawn",
521
+ },
522
+ {"preprocess", "updateSequential"},
523
+ )
524
+ RuntimeUI = (
525
+ 1005,
526
+ {
527
+ "preprocess",
528
+ "spawnTime",
529
+ "despawnTime",
530
+ "initialize",
531
+ "updateSequential",
532
+ "updateParallel",
533
+ "terminate",
534
+ "updateSpawn",
535
+ },
536
+ {"preprocess"},
537
+ )
538
+ RuntimeUIConfiguration = (
539
+ 1006,
540
+ {
541
+ "preprocess",
542
+ "spawnTime",
543
+ "despawnTime",
544
+ "initialize",
545
+ "updateSequential",
546
+ "updateParallel",
547
+ "terminate",
548
+ "updateSpawn",
549
+ },
550
+ {"preprocess"},
551
+ )
552
+ LevelMemory = (
553
+ 2000,
554
+ {
555
+ "preprocess",
556
+ "spawnTime",
557
+ "despawnTime",
558
+ "initialize",
559
+ "updateSequential",
560
+ "updateParallel",
561
+ "terminate",
562
+ "updateSpawn",
563
+ },
564
+ {"preprocess", "updateSequential"},
565
+ )
566
+ LevelData = (
567
+ 2001,
568
+ {
569
+ "preprocess",
570
+ "spawnTime",
571
+ "despawnTime",
572
+ "initialize",
573
+ "updateSequential",
574
+ "updateParallel",
575
+ "terminate",
576
+ "updateSpawn",
577
+ },
578
+ {"preprocess"},
579
+ )
580
+ LevelOption = (
581
+ 2002,
582
+ {
583
+ "preprocess",
584
+ "spawnTime",
585
+ "despawnTime",
586
+ "initialize",
587
+ "updateSequential",
588
+ "updateParallel",
589
+ "terminate",
590
+ "updateSpawn",
591
+ },
592
+ {},
593
+ )
594
+ LevelBucket = (
595
+ 2003,
596
+ {
597
+ "preprocess",
598
+ "spawnTime",
599
+ "despawnTime",
600
+ "initialize",
601
+ "updateSequential",
602
+ "updateParallel",
603
+ "terminate",
604
+ "updateSpawn",
605
+ },
606
+ {"preprocess"},
607
+ )
608
+ LevelScore = (
609
+ 2004,
610
+ {
611
+ "preprocess",
612
+ "spawnTime",
613
+ "despawnTime",
614
+ "initialize",
615
+ "updateSequential",
616
+ "updateParallel",
617
+ "terminate",
618
+ "updateSpawn",
619
+ },
620
+ {"preprocess"},
621
+ )
622
+ LevelLife = (
623
+ 2005,
624
+ {
625
+ "preprocess",
626
+ "spawnTime",
627
+ "despawnTime",
628
+ "initialize",
629
+ "updateSequential",
630
+ "updateParallel",
631
+ "terminate",
632
+ "updateSpawn",
633
+ },
634
+ {"preprocess"},
635
+ )
636
+ EngineRom = (
637
+ 3000,
638
+ {
639
+ "preprocess",
640
+ "spawnTime",
641
+ "despawnTime",
642
+ "initialize",
643
+ "updateSequential",
644
+ "updateParallel",
645
+ "terminate",
646
+ "updateSpawn",
647
+ },
648
+ {},
649
+ )
650
+ EntityMemory = (
651
+ 4000,
652
+ {"preprocess", "spawnTime", "despawnTime", "initialize", "updateSequential", "updateParallel", "terminate"},
653
+ {"preprocess", "spawnTime", "despawnTime", "initialize", "updateSequential", "updateParallel", "terminate"},
654
+ )
655
+ EntityData = (
656
+ 4001,
657
+ {"preprocess", "spawnTime", "despawnTime", "initialize", "updateSequential", "updateParallel", "terminate"},
658
+ {"preprocess"},
659
+ )
660
+ EntitySharedMemory = (
661
+ 4002,
662
+ {"preprocess", "spawnTime", "despawnTime", "initialize", "updateSequential", "updateParallel", "terminate"},
663
+ {"preprocess", "updateSequential"},
664
+ )
665
+ EntityInfo = (
666
+ 4003,
667
+ {"preprocess", "spawnTime", "despawnTime", "initialize", "updateSequential", "updateParallel", "terminate"},
668
+ {},
669
+ )
670
+ EntityInput = (
671
+ 4004,
672
+ {"preprocess", "spawnTime", "despawnTime", "initialize", "updateSequential", "updateParallel", "terminate"},
673
+ {"preprocess"},
674
+ )
675
+ EntityDataArray = (
676
+ 4101,
677
+ {
678
+ "preprocess",
679
+ "spawnTime",
680
+ "despawnTime",
681
+ "initialize",
682
+ "updateSequential",
683
+ "updateParallel",
684
+ "terminate",
685
+ "updateSpawn",
686
+ },
687
+ {"preprocess"},
688
+ )
689
+ EntitySharedMemoryArray = (
690
+ 4102,
691
+ {
692
+ "preprocess",
693
+ "spawnTime",
694
+ "despawnTime",
695
+ "initialize",
696
+ "updateSequential",
697
+ "updateParallel",
698
+ "terminate",
699
+ "updateSpawn",
700
+ },
701
+ {"preprocess", "updateSequential"},
702
+ )
703
+ EntityInfoArray = (
704
+ 4103,
705
+ {
706
+ "preprocess",
707
+ "spawnTime",
708
+ "despawnTime",
709
+ "initialize",
710
+ "updateSequential",
711
+ "updateParallel",
712
+ "terminate",
713
+ "updateSpawn",
714
+ },
715
+ {},
716
+ )
717
+ ArchetypeLife = (
718
+ 5000,
719
+ {
720
+ "preprocess",
721
+ "spawnTime",
722
+ "despawnTime",
723
+ "initialize",
724
+ "updateSequential",
725
+ "updateParallel",
726
+ "terminate",
727
+ "updateSpawn",
728
+ },
729
+ {"preprocess"},
730
+ )
731
+ TemporaryMemory = (
732
+ 10000,
733
+ {
734
+ "preprocess",
735
+ "spawnTime",
736
+ "despawnTime",
737
+ "initialize",
738
+ "updateSequential",
739
+ "updateParallel",
740
+ "terminate",
741
+ "updateSpawn",
742
+ },
743
+ {
744
+ "preprocess",
745
+ "spawnTime",
746
+ "despawnTime",
747
+ "initialize",
748
+ "updateSequential",
749
+ "updateParallel",
750
+ "terminate",
751
+ "updateSpawn",
752
+ },
753
+ )
754
+
755
+
756
+ type Block = TutorialBlock | PlayBlock | PreviewBlock | WatchBlock