-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #158 from nicolasfara/develop
New release v1.0.0
- Loading branch information
Showing
140 changed files
with
12,453 additions
and
2,837 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
benchmarks/src/main/scala/ecscala/ComponentsContainerBenchmark.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package ecscala | ||
|
||
import dev.atedeg.ecscala.given | ||
import dev.atedeg.ecscala.{ &:, CNil } | ||
import ecscala.utils.{ JmhSettings, Position, Velocity } | ||
import org.openjdk.jmh.annotations.Benchmark | ||
|
||
class ComponentsContainerBenchmark extends JmhSettings { | ||
|
||
@Benchmark | ||
def componentsContainerBenchmark: Unit = { | ||
val view = world.getView[Position &: Velocity &: CNil] | ||
view foreach { (entity, comps) => | ||
val pos = entity.getComponent[Position].get | ||
val vel = entity.getComponent[Velocity].get | ||
entity.setComponent(Position(pos.x + 1, pos.y + 1)) | ||
entity.setComponent(Velocity(vel.x + 1, vel.y + 1)) | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.