Skip to content
This repository was archived by the owner on Jul 16, 2024. It is now read-only.

Implementing Views#80

Open
Ukendio wants to merge 15 commits intomainfrom
views
Open

Implementing Views#80
Ukendio wants to merge 15 commits intomainfrom
views

Conversation

@Ukendio
Copy link
Contributor

@Ukendio Ukendio commented Dec 20, 2023

This is just one way to resolve #79 where we could potentially extend the API instead of changing queryResult:snapshot(). Currently the order of entities is undefined and may differ from a query or snapshot. Maybe we can fix this by using linked lists or something, need thoughts on this.

TODO

  • Adding exhaustive unit tests
    - [ ] Should be able to view following a queryResult:without() Decided that shouldn't block this feature
  • Should preserve the order of the query
  • Adding documentation
  • Implement using linked list

@Ukendio Ukendio marked this pull request as ready for review December 20, 2023 23:55
end

local dyingPeople = world:query(Player, Health, Poison):view()
local remainingHealth = dyingPeople:get(entity)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its unclear what "entity" is meant to be in this example to me. Is this an entityId?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Snapshot should return a "View" Handle

2 participants