sonolus.py 0.6.3__py3-none-any.whl → 0.6.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.
- sonolus/script/archetype.py +4 -2
- sonolus/script/easing.py +2 -2
- sonolus/script/internal/context.py +9 -4
- {sonolus_py-0.6.3.dist-info → sonolus_py-0.6.4.dist-info}/METADATA +1 -1
- {sonolus_py-0.6.3.dist-info → sonolus_py-0.6.4.dist-info}/RECORD +8 -8
- {sonolus_py-0.6.3.dist-info → sonolus_py-0.6.4.dist-info}/WHEEL +0 -0
- {sonolus_py-0.6.3.dist-info → sonolus_py-0.6.4.dist-info}/entry_points.txt +0 -0
- {sonolus_py-0.6.3.dist-info → sonolus_py-0.6.4.dist-info}/licenses/LICENSE +0 -0
sonolus/script/archetype.py
CHANGED
|
@@ -207,7 +207,7 @@ class _IsScoredDescriptor(SonolusDescriptor):
|
|
|
207
207
|
if instance is None:
|
|
208
208
|
return self.value
|
|
209
209
|
elif ctx():
|
|
210
|
-
|
|
210
|
+
return ctx().global_state.is_scored_by_archetype_id[instance.id]
|
|
211
211
|
else:
|
|
212
212
|
return self.value
|
|
213
213
|
|
|
@@ -237,7 +237,7 @@ class _KeyDescriptor(SonolusDescriptor):
|
|
|
237
237
|
|
|
238
238
|
def __get__(self, instance, owner):
|
|
239
239
|
if instance is not None and ctx():
|
|
240
|
-
return ctx().global_state.
|
|
240
|
+
return ctx().global_state.keys_by_archetype_id[instance.id]
|
|
241
241
|
else:
|
|
242
242
|
return self.value
|
|
243
243
|
|
|
@@ -604,6 +604,7 @@ class _BaseArchetype:
|
|
|
604
604
|
cls._key_ = cls.key
|
|
605
605
|
cls.key = _KeyDescriptor(cls.key)
|
|
606
606
|
cls.name = _NameDescriptor(cls.name)
|
|
607
|
+
cls._is_scored_ = cls.is_scored
|
|
607
608
|
cls.is_scored = _IsScoredDescriptor(cls.is_scored)
|
|
608
609
|
cls.life = _ArchetypeLifeDescriptor()
|
|
609
610
|
|
|
@@ -624,6 +625,7 @@ class _BaseArchetype:
|
|
|
624
625
|
"life",
|
|
625
626
|
"is_scored",
|
|
626
627
|
"_key_",
|
|
628
|
+
"_is_scored_",
|
|
627
629
|
"_derived_base_",
|
|
628
630
|
"_is_derived_",
|
|
629
631
|
"_default_callbacks_",
|
sonolus/script/easing.py
CHANGED
|
@@ -355,8 +355,8 @@ def smootherstep(x: float) -> float:
|
|
|
355
355
|
|
|
356
356
|
|
|
357
357
|
def step_start(x: float) -> float:
|
|
358
|
-
"""Step function returning 1.0 if x
|
|
359
|
-
return 1.0 if x
|
|
358
|
+
"""Step function returning 1.0 if x >= 0, otherwise 0.0."""
|
|
359
|
+
return 1.0 if x >= 0 else 0.0
|
|
360
360
|
|
|
361
361
|
|
|
362
362
|
def step_end(x: float) -> float:
|
|
@@ -42,7 +42,8 @@ debug_var = ContextVar("debug_var", default=_disabled_debug_config)
|
|
|
42
42
|
class GlobalContextState:
|
|
43
43
|
archetypes: dict[type, int]
|
|
44
44
|
archetypes_by_name: dict[str, type]
|
|
45
|
-
|
|
45
|
+
keys_by_archetype_id: Sequence[int]
|
|
46
|
+
is_scored_by_archetype_id: Sequence[bool]
|
|
46
47
|
rom: ReadOnlyMemory
|
|
47
48
|
const_mappings: dict[Any, int]
|
|
48
49
|
environment_mappings: dict[_GlobalInfo, int]
|
|
@@ -55,10 +56,14 @@ class GlobalContextState:
|
|
|
55
56
|
|
|
56
57
|
self.archetypes = archetypes or {}
|
|
57
58
|
self.archetypes_by_name = {type_.name: type_ for type_, _ in self.archetypes.items()} # type: ignore
|
|
58
|
-
self.
|
|
59
|
-
|
|
59
|
+
ordered_archetypes = sorted(self.archetypes, key=lambda a: self.archetypes[a])
|
|
60
|
+
self.keys_by_archetype_id = (
|
|
61
|
+
Array(*((getattr(a, "_key_", -1)) for a in ordered_archetypes)) if archetypes else Array[int, Literal[0]]()
|
|
62
|
+
)
|
|
63
|
+
self.is_scored_by_archetype_id = (
|
|
64
|
+
Array(*((getattr(a, "_is_scored_", False)) for a in ordered_archetypes))
|
|
60
65
|
if archetypes
|
|
61
|
-
else Array[
|
|
66
|
+
else Array[bool, Literal[0]]()
|
|
62
67
|
)
|
|
63
68
|
self.rom = ReadOnlyMemory() if rom is None else rom
|
|
64
69
|
self.const_mappings = {}
|
|
@@ -34,13 +34,13 @@ sonolus/build/level.py,sha256=yXsQtnabkJK0vuVmZ_Wr1jx37jFLgInCS7lTlXjkv9Q,706
|
|
|
34
34
|
sonolus/build/node.py,sha256=gnX71RYDUOK_gYMpinQi-bLWO4csqcfiG5gFmhxzSec,1330
|
|
35
35
|
sonolus/build/project.py,sha256=eHh4ioOjaFtt26bcefUuDZhMhFw8NXnjRTYPiEInQV8,6505
|
|
36
36
|
sonolus/script/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
37
|
-
sonolus/script/archetype.py,sha256=
|
|
37
|
+
sonolus/script/archetype.py,sha256=sgPAbYD1jEPnQf2LhRaZn_ySVyzaogNEqGU-69teyIs,47331
|
|
38
38
|
sonolus/script/array.py,sha256=9uOUHZIDMyMT9q3APcXJWXWt97yG-AZoRlxwrvSY6SU,12367
|
|
39
39
|
sonolus/script/array_like.py,sha256=hUDdDaP306kflVv9YomdHIMXogrVjxsBXCrLvB9QpuE,9681
|
|
40
40
|
sonolus/script/bucket.py,sha256=SNqnfLGpnO_u-3LFFazdgzNk332OdDUIlmZHsuoVZuE,7674
|
|
41
41
|
sonolus/script/containers.py,sha256=L3rzPfN1cDb2m02k9qRyjnGxJx07X3q3MccCaL5tNJ8,18773
|
|
42
42
|
sonolus/script/debug.py,sha256=Vi97opuk9fMB5bdpzPCBpa2oZeTff7FQ4WzdeDE5trk,4557
|
|
43
|
-
sonolus/script/easing.py,sha256=
|
|
43
|
+
sonolus/script/easing.py,sha256=2FUJI_nfp990P_armCcRqHm2329O985glJAhSC6tnxs,11379
|
|
44
44
|
sonolus/script/effect.py,sha256=RQdsABqfi3sIku1jJDwyeD81devVyBhWQ47HIjfiMy0,5978
|
|
45
45
|
sonolus/script/engine.py,sha256=etI9dJsQ7V9YZICVNZg54WqpLijPxG8eTPHiV-_EiG8,10687
|
|
46
46
|
sonolus/script/globals.py,sha256=nlXSNS4NRXsgQU2AJImVIs752h1WqsMnShSKgU011c4,10270
|
|
@@ -71,7 +71,7 @@ sonolus/script/internal/__init__.py,sha256=T6rzLoiOUaiSQtaHMZ88SNO-ijSjSSv33TKtU
|
|
|
71
71
|
sonolus/script/internal/builtin_impls.py,sha256=R1h3IOlWzolPfc9yoma2cBN0F5cBhj_JNP-TTdKoBlc,13186
|
|
72
72
|
sonolus/script/internal/callbacks.py,sha256=vWzJG8uiJoEtsNnbeZPqOHogCwoLpz2D1MnHY2wVV8s,2801
|
|
73
73
|
sonolus/script/internal/constant.py,sha256=3ycbGkDJVUwcrCZ96vLjAoAARgsvaqDM8rJ_YCrLrvo,4289
|
|
74
|
-
sonolus/script/internal/context.py,sha256=
|
|
74
|
+
sonolus/script/internal/context.py,sha256=Cd9US3GNHxs_96UcVdBAXGD-H4gCNnV9h5OfCWbtoOg,17668
|
|
75
75
|
sonolus/script/internal/descriptor.py,sha256=XRFey-EjiAm_--KsNl-8N0Mi_iyQwlPh68gDp0pKf3E,392
|
|
76
76
|
sonolus/script/internal/dict_impl.py,sha256=alu_wKGSk1kZajNf64qbe7t71shEzD4N5xNIATH8Swo,1885
|
|
77
77
|
sonolus/script/internal/error.py,sha256=ZNnsvQVQAnFKzcvsm6-sste2lo-tP5pPI8sD7XlAZWc,490
|
|
@@ -86,8 +86,8 @@ sonolus/script/internal/simulation_context.py,sha256=LGxLTvxbqBIhoe1R-SfwGajNIDw
|
|
|
86
86
|
sonolus/script/internal/transient.py,sha256=y2AWABqF1aoaP6H4_2u4MMpNioC4OsZQCtPyNI0txqo,1634
|
|
87
87
|
sonolus/script/internal/tuple_impl.py,sha256=DPNdmmRmupU8Ah4_XKq6-PdT336l4nt15_uCJKQGkkk,3587
|
|
88
88
|
sonolus/script/internal/value.py,sha256=OngrCdmY_h6mV2Zgwqhuo4eYFad0kTk6263UAxctZcY,6963
|
|
89
|
-
sonolus_py-0.6.
|
|
90
|
-
sonolus_py-0.6.
|
|
91
|
-
sonolus_py-0.6.
|
|
92
|
-
sonolus_py-0.6.
|
|
93
|
-
sonolus_py-0.6.
|
|
89
|
+
sonolus_py-0.6.4.dist-info/METADATA,sha256=0snzpKah3Osilgz5MfftDE9jFV6ydvWIJ4YroK54eBQ,302
|
|
90
|
+
sonolus_py-0.6.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
91
|
+
sonolus_py-0.6.4.dist-info/entry_points.txt,sha256=oTYspY_b7SA8TptEMTDxh4-Aj-ZVPnYC9f1lqH6s9G4,54
|
|
92
|
+
sonolus_py-0.6.4.dist-info/licenses/LICENSE,sha256=JEKpqVhQYfEc7zg3Mj462sKbKYmO1K7WmvX1qvg9IJk,1067
|
|
93
|
+
sonolus_py-0.6.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|