Suggestion Ability to invert a query option

Discussion in 'Client & Site Suggestions' started by Cloud, May 13, 2016.

  1. Example: Looking to find entities with animations that don't equal -1, so you would invoke a method that would make the next method call do the exact opposite or something. Typing super quickly as I'm in a rush and this implementation I proposed is shit but yeah, the point stands that it's something useful. Gotta run.
  2. Excellent idea, I'll tag in @Vap...

    Joking aside, isn't this the purpose of predicates?
  3. Good suggestion, @SlashnHax can you add this please?
  4. *previous method call

    It's more standard. animations(-1).negate(). But @Party brings up a good point. Predicates handle this already. I'd rather keep the wheel re-invention to a minimum. Our wrapper methods should be used exclusively for simple things and Bot Authors should graduate to using Predicates once their needs are greater than the available convenience methods.
  5. I would if I could ;)

    Iirc, the QueryBuilders have an .accepts(T t) method, so a simple implementation would be to use that, in a similar way that Predicate's negate uses test.
    Idk how efficient it would be though.

    Edit: nvm I misread and thought you were talking about negating the entire query xD
  6. Our convenience methods are not adequately convenient once they inconvenience me.
    Aidden likes this.
  7. What if you added MORE convenience methods? Like idsExcept() or namesExcept() : ^)
  8. pls no
    --- Double Post Merged, May 14, 2016, Original Post Date: May 14, 2016 ---
    Use a predicate. >.>
  9. We can't optimize order and implement elegant caching when a predicate is used, thus defeating the purpose of us lazily evaluating queries.
  10. Sure we can by allowing the user to specify what data the predicate tests by as an Enum... argument. It would yield a more robust solution anyway. @Vaped

    Sent from my iPhone using Tapatalk
  11. GameObjects.newQuery().filter(() -> ..., GameObject.FilterType.ID, GameObject.FilterType.MODEL)

    Sent from my iPhone using Tapatalk
  12. We could then use these FilterTypes on a 1-X intensity scale to prioritize filtering. We could also allow devs to provide their own intensity level when our defined ones aren't sufficient.

    Sent from my iPhone using Tapatalk

Share This Page