specs icon indicating copy to clipboard operation
specs copied to clipboard

More in-depth explanations of component removal and adding

Open Masterhigure opened this issue 6 years ago • 7 comments

The information available in the book on component adding and removal (specifically within the run() function of a System) is quite brief. The only example completely avoids deletions which, at least for LazyUpdate, have a drastically different syntax from insertions.

Also, I would appreciate examples on how to do insertions and especially deletions inside a join() loop. Insertions aren't that problematic because you usually aren't join()-ing over the component you're inserting into. But for deletion this is different.

I think that section would be much better if it addressed these issues. For instance, by giving an example using drain(), and a canonical example of non-lazily deleting entities from some component inside a loop without drain() (because maybe you don't want to remove all of them).

Masterhigure avatar Nov 16 '18 08:11 Masterhigure

Would love to see this too.

jrmiller82 avatar Nov 16 '18 19:11 jrmiller82

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Feel free to comment if this is still relevant.

stale[bot] avatar Mar 30 '19 09:03 stale[bot]

This seems still relevant; I'm thinking that maybe we could solve this by adding a demo.

torkleyy avatar Apr 04 '19 07:04 torkleyy

I can spend some time on this, can we agree on a broad set of changes?

What we have now:

  • Chapter 06 (System Data) contains a small part about adding and removing components

What I assume we want:

  • Chapter 06 focuses on System Data (add/removal of components is split out)
  • A new chapter addresses common Component usecases

ldesgoui avatar May 08 '19 10:05 ldesgoui

I'm not quite sure myself where this could fit into. In any case, putting all component related docs in the same place + referencing those sections seems like a good idea.

torkleyy avatar May 08 '19 14:05 torkleyy

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Feel free to comment if this is still relevant.

stale[bot] avatar Jul 07 '19 14:07 stale[bot]

I'm not quite sure myself where this could fit into. In any case, putting all component related docs in the same place + referencing those sections seems like a good idea.

I know this is closed but this is still really relevant. Like, we still haven't figured out how to do this: and a canonical example of non-lazily deleting entities from some component inside a loop without drain()

I'd like to spend time working on this. Would need some sort of guidance though on what exactly to add though. Maybe we can agree on a list of stuffs to write about? cc: @torkleyy

atsuzaki avatar Dec 09 '19 04:12 atsuzaki