Skip to content

Commit

Permalink
Updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
sedyh committed Dec 28, 2021
1 parent e0b7efd commit bf6de7f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/engine/view.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func makeView(world *world, components ...interface{}) *view {
}

// Each iterates all entities with the previously selected components.
// This method is for iteration only.
func (v *view) Each(consumer func(entity Entity)) {
for _, e := range v.w.entities {
if e.mask.contains(v.mask) {
Expand All @@ -45,7 +46,7 @@ func (v *view) Each(consumer func(entity Entity)) {
}

// Filter returns a list of entities with the previously selected components for separate sorting and iteration.
// It is save to delete from here
// It is safe to delete entities from here, you also can use this to sort your entities.
func (v *view) Filter() []Entity {
entities := make([]Entity, 0, 2)
for _, e := range v.w.entities {
Expand Down

0 comments on commit bf6de7f

Please sign in to comment.