Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup Guide for jecs #20

Open
YetAnotherClown opened this issue Jul 7, 2024 · 0 comments
Open

Setup Guide for jecs #20

YetAnotherClown opened this issue Jul 7, 2024 · 0 comments
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@YetAnotherClown
Copy link
Owner

YetAnotherClown commented Jul 7, 2024

As an effort to provide well made documentation for YetAnotherNet, it would be great to provide an official setup guide for jecs in the Documentation, similar to the Matter and ECR setup guide.

This is an example of how you could integrate YetAnotherNet in jecs, provided by @Ukendio.
We should build and improve upon this example when creating a "best setup" for jecs as this may not be the most optimal way of going about this.

local trackers = {}
for component in world:query(Networked) do
  local tracker = ChangeTracker(component)
  table.insert(trackers, tracker)
end

local function sys(world) 
  for _, tracker in trackers do 
    tracker:track(world, function(changes) 
      for id in changes.added() do 
        routes.added:send(id)
      end
      for id, old, new in changes.changed() do 
        routes.changed:send(id, old, new)
      end
      for id in changes.removed() do 
        routes.removed:send(id)
      end
    end)
  end
end
@YetAnotherClown YetAnotherClown added documentation Improvements or additions to documentation good first issue Good for newcomers labels Jul 7, 2024
@YetAnotherClown YetAnotherClown changed the title JECS Setup Guide Setup Guide for jecs Jul 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant