kaplay icon indicating copy to clipboard operation
kaplay copied to clipboard

feat: upgrade get

Open mflerackers opened this issue 1 year ago • 3 comments

mflerackers avatar May 24 '24 09:05 mflerackers

Currently get only takes the tag or tags objects need to have in order to be returned. There is also an optional recursive flag to return descendants instead of children. This is quite limited. The new get would takes an option struct:

type GetOpt {
  include?: string[]
  exclude?: string[]
  distance?: number
  visible?: boolean
  hierarchy?: "children" | "siblings" | "ancestors" | "descendants"
}

This allows the user to do inclusive and exclusive queries, look for nearby or far away objects, look for visible or invisible objects and have more control over where to search in the hierarchy. It also allows use to speed up these operations (caching, quadtree, etc) and have users enjoy these optimisations immediately without changes to their code.

mflerackers avatar May 24 '24 09:05 mflerackers

This would be useful to have

niceEli avatar May 24 '24 14:05 niceEli

Wouldn't the title be update get? Thought it was confusing

amyspark-ng avatar May 26 '24 19:05 amyspark-ng

Wouldn't the title be update get? Thought it was confusing

upgrade was right idk what was i on

amyspark-ng avatar Jun 13 '24 16:06 amyspark-ng