fireblade-engine / ecs

A dependency free, lightweight, fast Entity-Component System (ECS) implementation in Swift
MIT License
110 stars 11 forks source link

EntitiesIterator #33

Closed ctreffs closed 4 years ago

ctreffs commented 4 years ago

This PR addresses the lack of the ability to iterate over all entities in a Nexus (issue #32) by adding an EntitiesIterator.

Usage:

let nexus = Nexus()

let lazyEntityArray = Array(nexus.makeEntitiesIterator()).lazy

for entity in lazyEntityArray {
   // ...
}
codecov[bot] commented 4 years ago

Codecov Report

Merging #33 into master will increase coverage by 0.01%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master      #33      +/-   ##
==========================================
+ Coverage   97.86%   97.88%   +0.01%     
==========================================
  Files          30       30              
  Lines        1314     1325      +11     
==========================================
+ Hits         1286     1297      +11     
  Misses         28       28