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

Request Make TreeBot treat null children properly

Discussion in 'Client & Site Suggestions' started by Savior, Feb 15, 2017.

  1. SlashnHax

    Joined:
    Dec 10, 2014
    Messages:
    3,210
    Likes Received:
    1,042
    I think I get what you're saying, but there are cases where you can't replace that branch with a leaf easily and elegantly
     
  2. Party

    Party Client Developer

    Joined:
    Oct 12, 2015
    Messages:
    3,708
    Likes Received:
    1,606
    Can you think of one? Rather than the condition being returned in validate() it would just be an if statement within execute().
     
  3. Savior

    Savior Java Warlord

    Joined:
    Nov 17, 2014
    Messages:
    4,906
    Likes Received:
    2,748
    Thats like saying if you have a leaf in a tree (by definition a node without children), this leaf needs two leafs as children. It doesnt make sense to me
    --- Double Post Merged, Feb 21, 2017, Original Post Date: Feb 21, 2017 ---
    Gl with that if the subtree is fairly complex
     
  4. Party

    Party Client Developer

    Joined:
    Oct 12, 2015
    Messages:
    3,708
    Likes Received:
    1,606
    That's not what it's like saying at all.
    --- Double Post Merged, Feb 21, 2017 ---
    I mean don't get me wrong I'm not against the idea, I just haven't come across a use case.
     
  5. Savior

    Savior Java Warlord

    Joined:
    Nov 17, 2014
    Messages:
    4,906
    Likes Received:
    2,748
    Yes it is, you are saying that null children should be replaced with leafs. Well leafs are defined by having no/null children.
     
  6. Party

    Party Client Developer

    Joined:
    Oct 12, 2015
    Messages:
    3,708
    Likes Received:
    1,606
    No, I'm saying if you have a branch with one child, the branch and child should be consolidated into a leaf node.
     

Share This Page

Loading...