Skip to content

[Merged by Bors] - Add More Description to the Iter Combinations Documentation#6260

Closed
Carter0 wants to merge 11 commits intobevyengine:mainfrom
Carter0:add-iter-combinations-example
Closed

[Merged by Bors] - Add More Description to the Iter Combinations Documentation#6260
Carter0 wants to merge 11 commits intobevyengine:mainfrom
Carter0:add-iter-combinations-example

Conversation

@Carter0
Copy link
Contributor

@Carter0 Carter0 commented Oct 14, 2022

Objective

I was trying to implement a collision system for my game, and believed that the iter_combinations method might be what I need. But I couldn't find a simple explanation of what a combination was in Bevy and thought it could use some more explanation.

Solution

I added some description to the documentation that can hopefully further elaborate on what a combination is.

I also changed up the docs for the method because a combination is a different thing than a permutation but the Bevy docs seemed to use them interchangeably.

@alice-i-cecile alice-i-cecile added C-Docs An addition or correction to our documentation A-ECS Entities, components, systems, and events C-Examples An addition or correction to our examples labels Oct 14, 2022
Copy link
Contributor

@bzm3r bzm3r left a comment

Choose a reason for hiding this comment

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

Thanks for making this example. I did not know about iter_combinations before today, so this is really cool to learn about. I left some questions about things I did not understand from your example. Hopefully it helps in clarifying them?

@harudagondi
Copy link
Member

I don't think this is good example, as the usage here is very abstract. I was expecting something like a showcase of a simple solar system. (Turns out, there is an example lol)

In the mean time, I would also like to see the usage of iter_combinations_mut here.

@Carter0
Copy link
Contributor Author

Carter0 commented Oct 15, 2022

I don't think this is good example, as the usage here is very abstract. I was expecting something like a showcase of a simple solar system. (Turns out, there is an example lol)

In the mean time, I would also like to see the usage of iter_combinations_mut here.

Yeah, I agree the example code isn't great. Like it's not a practical game development example. But that's also not what I am trying to teach.

I think the confusing thing about iter_combinations is how it works. Like what is a combination and what is a permutation. And I think the best way to teach that is with an example like mine, where I can do things like show [1, 2], [1,3], etc...

I'm working on some collision code right now which uses iter_combinations, but I don't think it would do a good job at all of explaining how iter_combinations works. I think the other example of iter_combinations, using the solar system, is a good example of that (though it does need comments IMHO).

I was thinking perhaps this would be better off as a doc comment somehow? But I really like having the example of [1, 2], etc. I think it's easier for users to see the pattern and understand what a combination is. Ill try to to make it a comment in the docs, I think it might make more sense there.

Also TBH, I think if users know how iter_combinations works, then they basically know how iter_combinations_mut works since I don't think thats the complicated concept here.

@Carter0 Carter0 marked this pull request as ready for review October 15, 2022 20:59
@Carter0 Carter0 changed the title Add a Simple Iter Combinations Example Add More Description to the Iter Combinations Documentation Oct 15, 2022
@harudagondi
Copy link
Member

You should change update the docs (or link to this) in Query::iter_combinations, Query_iter_combinations_mut, and QueryCombinationIter.

@Carter0 Carter0 force-pushed the add-iter-combinations-example branch from cfe8e0e to f7f33cd Compare October 16, 2022 18:03
Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

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

Left some suggestions on how to improve the wording for clarity and readability. Thanks!

Carter0 and others added 4 commits October 17, 2022 18:07
Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
@Carter0 Carter0 force-pushed the add-iter-combinations-example branch from 63bbd73 to 71b7ae1 Compare October 17, 2022 22:22
@alice-i-cecile
Copy link
Member

Great work on the changes, thanks!

@alice-i-cecile
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request Oct 25, 2022
# Objective

I was trying to implement a collision system for my game, and believed that the iter_combinations method might be what I need. But I couldn't find a simple explanation of what a combination was in Bevy and thought it could use some more explanation. 

## Solution

I added some description to the documentation that can hopefully further elaborate on what a combination is. 

I also changed up the docs for the method because a combination is a different thing than a permutation but the Bevy docs seemed to use them interchangeably.
@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Oct 25, 2022
@bors bors bot changed the title Add More Description to the Iter Combinations Documentation [Merged by Bors] - Add More Description to the Iter Combinations Documentation Oct 25, 2022
@bors bors bot closed this Oct 25, 2022
james7132 pushed a commit to james7132/bevy that referenced this pull request Oct 28, 2022
…ne#6260)

# Objective

I was trying to implement a collision system for my game, and believed that the iter_combinations method might be what I need. But I couldn't find a simple explanation of what a combination was in Bevy and thought it could use some more explanation. 

## Solution

I added some description to the documentation that can hopefully further elaborate on what a combination is. 

I also changed up the docs for the method because a combination is a different thing than a permutation but the Bevy docs seemed to use them interchangeably.
Pietrek14 pushed a commit to Pietrek14/bevy that referenced this pull request Dec 17, 2022
…ne#6260)

# Objective

I was trying to implement a collision system for my game, and believed that the iter_combinations method might be what I need. But I couldn't find a simple explanation of what a combination was in Bevy and thought it could use some more explanation. 

## Solution

I added some description to the documentation that can hopefully further elaborate on what a combination is. 

I also changed up the docs for the method because a combination is a different thing than a permutation but the Bevy docs seemed to use them interchangeably.
ItsDoot pushed a commit to ItsDoot/bevy that referenced this pull request Feb 1, 2023
…ne#6260)

# Objective

I was trying to implement a collision system for my game, and believed that the iter_combinations method might be what I need. But I couldn't find a simple explanation of what a combination was in Bevy and thought it could use some more explanation. 

## Solution

I added some description to the documentation that can hopefully further elaborate on what a combination is. 

I also changed up the docs for the method because a combination is a different thing than a permutation but the Bevy docs seemed to use them interchangeably.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ECS Entities, components, systems, and events C-Docs An addition or correction to our documentation C-Examples An addition or correction to our examples S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants