transfer data between objects

BlitzMax Forums/BlitzMax Programming/transfer data between objects

Peter(Posted 2008) [#1]
Is there an example out there that describe the use of the event system for transferring data between objects that are not directly accessible (like globals)?

Peter


Dreamora(Posted 2008) [#2]
Simply put them in the extra field of the event to transfer the object then you can interact with it.


Peter(Posted 2008) [#3]
Seems easy, but how does the other object get to know that there is some data ready for it?


Dreamora(Posted 2008) [#4]
Well, the event most likely is unique (your own event, not a default one), so you will send it to that object to process in some way.
otherwise nothing will happen.

you need to write your app in a way that allows them to interact with each other in some way, at simplest through subscriber pattern like structures


Peter(Posted 2008) [#5]
I think I've got an idea about what to do.

But is there an example or even better a tutorial about that event stuff.

Pseudocode, but with the respective BMax commands would be enough.


Dreamora(Posted 2008) [#6]
Assaris tutorials on 2dgamecreators.com