TodePond / Arroost

arrows in arrows in arrows
https://arroost.com
MIT License
114 stars 8 forks source link

trigger end of pulse #53

Closed TodePond closed 1 year ago

TodePond commented 1 year ago

we need to know when it happens.

TodePond commented 1 year ago

we can't know that without having more information about source + target.

I propose a refactor of source type to nod type. and we need to define the relationships between them. Like... what happens when a specific source goes to a specific target? We could define the callbacks for each relationship, with varying degrees of specifity.

eg: Creation to Destruction eg: Creation to magnet eg: Creation to (anything)

Like a big switch statement

EDIT: instead of having a config for this, I'm just gonna do it in one big function

TodePond commented 1 year ago

added data to pulse

some more notes:

Screenshot 2023-07-03 at 19 35 32

notes:

pulses need to be able to store a nod in their data. we can't get it from reference because it might not exist anymore. the nod doesn't need to contain a pulse - because it's just a template. maybe NodTemplate.

currently there's some logic for choosing if pulses should transform or not. replace that with this kinda thing.

btw there's a magnet type. but there's also a slot type, which represents the end of an arrow of time. it's what we replace stuff with when a magnet attaches to something. if we delete something, we're really just replacing it with a slot. if we create something, we're really just replacing a slot with the created thing. in the UI, when we move an unattached arrow of time's end and magnet, we're really moving the slot.

pulseBehave(nod, data, nexts)

if pulse is creation if nod is slot replace slot with template data

as a back up to most things we could... just continue the pulse? just revert the pulse back to any? just change the pulse to whatever nod we're on? maybe we could just fine tune it. giving+throwing an error for anything we haven't accounted for and implemented yet

TodePond commented 1 year ago

removed source from pulse, because we're replacing that use-case with data now

TodePond commented 1 year ago

added a note on pulse data, suggesting we could add more to it over time

TodePond commented 1 year ago

removed tests for pulse type transform, gonna refactor that now

TodePond commented 1 year ago

we now have a behave function! lets start building it, adding any extra api stuff we need

TodePond commented 1 year ago

it's now ready! Moved pulse data to peak data, as that's the data type that we want to be dealing with (just pure data).

pulse to peak nod to template

gonna need to add more stuff to template for sure!

TodePond commented 1 year ago

behave functions now return a Behaviour object, which include...

a Peak (which can be transformed from the original) and an array of Operations (which should instruct NOGAN how to change)

TodePond commented 1 year ago

ok NO.

operations should just be part of peak lol

TodePond commented 1 year ago

refactored operations to peak

TodePond commented 1 year ago

it's done!