Updated the Code to be mildly more optimized and Idiomatic to Java#1
Open
That-Madman wants to merge 11 commits intoftc16072:mainfrom
Open
Updated the Code to be mildly more optimized and Idiomatic to Java#1That-Madman wants to merge 11 commits intoftc16072:mainfrom
That-Madman wants to merge 11 commits intoftc16072:mainfrom
Conversation
Cleaned up Not.java to properly Java best practices. This includes a minor change to the constructor to properly fit the this/arg dichotomy, and also replaced tick's return method to be more efficient through switch statements, also making it easier to read.
Move around the code for a more idiomatic format, and also allowing hopefully for a more opportunistic memory efficiency.
Applied to the same fixes of Sequence to Failover.
Fixed For loop to not have redundant variables
Made the code cleaner with a tenary operator
Mainly just some cosmetic shifts to properly indent.
Added formatting to be more legible.
Added the ability for Parallel to bail early if it cannot meet the required successes
Added an secondary Parallel version that maintains old functionality so as to allow for if a user needs to finish all running Nodes still.
updated Javadoc
Changed the name of Failover to Fallback to both fit with the Quantum Quacks behavior tree website and also the original ideas of the Behavior Trees
Author
|
I added a few more things, such as implementing the intended functionality for Parallel, renaming Failover to Fallback to better align with the typical name for the decorator, and also some further formatting. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I updated several classes in minor ways to improve on them. This includes shifting variables to optimize memory allocation and allow for potentially improved behavior of the garbage collector and switching bulky if and if-else statements to more efficient or at least more legible switch statements or tenary operators, whichever suited the situation better.
I was going to change Failover to Fallback to match the code generated by the Quantum Quacks FTC Behavior Tree website, but that would cause problems with backwards compatibility.
All changes preserve original behavior and should be completely backwards compatible.