1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Resolved References in the leaf nodes

Discussion in 'Developer Support' started by MaskedMouse, Sep 2, 2017.

  1. MaskedMouse

    Joined:
    Feb 21, 2016
    Messages:
    60
    Likes Received:
    11
    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?
     
    #1 MaskedMouse, Sep 2, 2017
    Last edited: Sep 2, 2017
  2. Best Answer:
    Post #2 by Savior, Sep 2, 2017
  3. Savior

    Savior Java Warlord

    Joined:
    Nov 17, 2014
    Messages:
    4,906
    Likes Received:
    2,748
    Environment.getBot()
     
    MaskedMouse likes this.
  4. MaskedMouse

    Joined:
    Feb 21, 2016
    Messages:
    60
    Likes Received:
    11
    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 (Text):
    1. (MyRootClass) Environment.getBot();
     
    #3 MaskedMouse, Sep 2, 2017
    Last edited: Sep 2, 2017

Share This Page

Loading...