Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Resolved References in the leaf nodes

Joined
Feb 21, 2016
Messages
60
How does one get a reference of the embeddable UI or the bot root class in the leaf nodes without passing it down in the whole tree?

The problem is, I've had a static container but I didn't think of multiple instances, so the static container ain't allowed on the bot store. kind of stupid of me because due to the nature of statics of how they work, one cannot use multiple instances with that. Each bot instance requires its own set of variables.
So now instead of using a static class, I am going to need a reference of the bot root class or the embeddable UI in my leaf nodes.
I am just not sure how to do that other than passing it down the whole tree... but that is quite the process which I kind of want to avoid if possible.

Are there any idea's?
 
Last edited:
Joined
Feb 21, 2016
Messages
60
Environment.getBot()
Ah I've seen that before, it returns AbstractBot so I didn't think of it as my root class but rather some API to check whether the bot itself non related is running, paused or stopped etc.

I've now implemented to cast it to my root class

Code:
(MyRootClass) Environment.getBot();
 
Last edited:
Top