• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Snippet] BooleanExpression

Updates

Added
method replace takes boolexpr expression returns nothing

Allowed adding null boolean expressions

Fixed a bug in the expression builder that was causing an infinite loop when the entire tree was empty/filled with nulls

edit
Also fixed the new replace method, I wasn't thinking when I added it in =), it works now

edit
Fixed another thing. Was destroying the added boolean expressions, which I shouldn't have been doing.
 
Last edited:
Improved performance of the build method, meaning less operations are used

edit
Improved performance with null expressions. Null expressions are no longer included in the tree, only placeholders are kept. This means that they won't clutter the trigger, making the trigger as fast as possible.

edit
Fixed a bug I introduced in the new builder

Removed length, now just calculates length by iterating over list. Why? Because some nodes on the list may be null. Keep in mind that a list with 8 nodes may have like 511 functions, so calculating the length of the list is not a heavy operation.

edit
Fixed builder

edit
Fixed remove (forgot one check with the big change)
 
Last edited:
Top