Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New release v1.0.0 #158

Merged
merged 481 commits into from
Oct 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
481 commits
Select commit Hold shift + click to select a range
bf638da
Remove components from space partition iterator
ndido98 Sep 30, 2021
8750d32
Fix formatting
ndido98 Sep 30, 2021
124b78f
Fix broken test
ndido98 Oct 2, 2021
2679603
Address review comments
ndido98 Oct 2, 2021
e263270
Update remaining effort
nicolasfara Oct 2, 2021
dee5c83
Change addComponent to setComponent
ndido98 Oct 3, 2021
8ad3290
Disallow adding the same component to two entities
ndido98 Oct 3, 2021
3d61383
Address review comments
ndido98 Oct 3, 2021
ff275f6
Address review comments
ndido98 Oct 3, 2021
fd04491
General description for each section
nicolasfara Oct 3, 2021
2ed0f02
Add sections and subsections
nicolasfara Oct 3, 2021
2f18595
Add benchmarks section
nicolasfara Oct 3, 2021
5f28520
Add optional arguments in MouseState apply
Oct 2, 2021
14e80ec
Add first draft of precondition testing
Oct 2, 2021
66ac9c7
Add hashCode and toString to PlayState and MouseState
Oct 3, 2021
a704ed0
Remove unused Precondition testing file
Oct 3, 2021
8c75427
Add utilities to check systems' preconditions
Oct 3, 2021
609ebf6
Refactor tests to check all preconditions
Oct 3, 2021
c834e50
If a drag is made when the game is playing the game state not change
nicolasfara Oct 2, 2021
0da80f5
Fix formatting
Oct 3, 2021
76f4426
Remove println from code
Oct 3, 2021
b18b33a
Change addComponent with setComponent
Oct 3, 2021
cf00c42
Convert PlayState and MouseState into case class
nicolasfara Oct 4, 2021
b64351c
Rename systems and change hierarchy
ndido98 Oct 3, 2021
ea95d13
Reformat files
ndido98 Oct 3, 2021
27b132d
Address review comments
ndido98 Oct 4, 2021
6521fcc
Make collision system use a readonly version of the space partition c…
ndido98 Oct 4, 2021
5caa0ae
Fix formatting
ndido98 Oct 4, 2021
b95ed28
Fix tests not passing
ndido98 Oct 4, 2021
295aebd
Update product backlog
vitlinda Oct 5, 2021
befeca1
Add sprint 8 retrospective
vitlinda Oct 5, 2021
f69854e
Fix bug with components update
Oct 5, 2021
46acded
Improve remove component readability
Oct 5, 2021
d373f18
Replace foreach on Option with map
Oct 5, 2021
47aa87d
Add TestFX dependencies
Oct 1, 2021
fb62472
Fix dragging handler
Oct 4, 2021
49b5018
Add monocle and JUnit to test GUI
Oct 5, 2021
4e5eb26
Add GUI tests
Oct 5, 2021
a7b9e51
Fix formatting
Oct 5, 2021
311ef5e
Slightly refactor demo code
Oct 6, 2021
7fe28c8
Remove unused imports from GUITest
Oct 6, 2021
6414b60
Add regression test
Oct 6, 2021
e0cc060
Remove empty label from fxml
Oct 6, 2021
3c3709a
Reorder imports in core library
Oct 6, 2021
f955bec
Reorder imports in demo project
Oct 6, 2021
a57ce8b
Fix formatting
Oct 6, 2021
fed2400
Remove code duplication in ExcludingViewIterator
ndido98 Oct 6, 2021
ecbc6f2
Remove iterable map
ndido98 Oct 6, 2021
2de4711
Move ComponentsContainerTest to reflect core package structure
ndido98 Oct 6, 2021
de8ede6
Add introduction
ndido98 Oct 4, 2021
09ad6e8
Finalize intro
ndido98 Oct 5, 2021
d9678cd
Address review comments
ndido98 Oct 5, 2021
3baa8b6
Address review comments
ndido98 Oct 6, 2021
b9fced7
Fix bibliography ordering
ndido98 Oct 6, 2021
8c1edc8
Use xspace to fix missing spaces
ndido98 Oct 6, 2021
9f2a636
Add first draft of view subsubsection
ndido98 Oct 6, 2021
7d5e8a8
Add first draft of system subsubsection
ndido98 Oct 6, 2021
3ba21de
Simplify package structure
Oct 6, 2021
8a9d8d4
Fix formatting
Oct 6, 2021
5213ba7
Remove unused imports from core library
Oct 6, 2021
5b85461
Remove unused imports from demo
Oct 6, 2021
9afe314
Remove unused imports from core library tests
Oct 6, 2021
bb00843
Remove unused imports from demo tests
Oct 6, 2021
f8dccb3
Fix formatting
Oct 7, 2021
76c3d80
Add missing import
Oct 7, 2021
3c15c2f
Exclude macro files from coverage report
Oct 7, 2021
fa86875
Merge pull request #141 from nicolasfara/feature/gc-rework-packages
ndido98 Oct 7, 2021
8e05444
Remove first name
ndido98 Oct 7, 2021
6ba3bde
Address review comments
ndido98 Oct 7, 2021
a2acc8a
Address review comments
ndido98 Oct 7, 2021
d5a4d0f
Address review comments
ndido98 Oct 7, 2021
42ff163
Merge pull request #140 from nicolasfara/feature/ndd-report-impl
ndido98 Oct 8, 2021
6a8869b
Add demo skeleton
ndido98 Oct 8, 2021
e5e39d3
Merge pull request #144 from nicolasfara/feature/ndd-report-demo-skel…
giacomocavalieri Oct 8, 2021
636a09a
Development process draft
vitlinda Oct 7, 2021
e0956a3
Almost finished development draft
vitlinda Oct 7, 2021
83a5936
Add issues chapter
vitlinda Oct 7, 2021
74cf7e6
Little refactor of retrospective chapter
vitlinda Oct 7, 2021
3cf5735
Add development process
vitlinda Oct 7, 2021
b7adb28
Refactor problem section
vitlinda Oct 7, 2021
d47f6d4
Deleted redundance
vitlinda Oct 7, 2021
3ef2191
Sentences corrections
vitlinda Oct 7, 2021
6273ae1
Sentences review
vitlinda Oct 8, 2021
b3fdef4
Add a comma
vitlinda Oct 8, 2021
84b98b9
Change some sentencies
vitlinda Oct 8, 2021
f22f6ce
Merge pull request #143 from nicolasfara/feature/lv-report-process
vitlinda Oct 9, 2021
e9784c1
Add scala code for test
nicolasfara Oct 3, 2021
a63e3a2
Type error scalatest bug
nicolasfara Oct 3, 2021
5175ee6
Change fig reference
nicolasfara Oct 5, 2021
d775c4e
Add intellij bug
nicolasfara Oct 4, 2021
1b55999
Fix typos
nicolasfara Oct 4, 2021
822eb97
Add sequence diagram description
nicolasfara Oct 4, 2021
de1b0be
Minor typo fix
nicolasfara Oct 4, 2021
bcad8b1
Rewrite sentences
nicolasfara Oct 4, 2021
5603722
Add work subdivision section
nicolasfara Oct 5, 2021
eefa7e4
Rewrite senteces
nicolasfara Oct 5, 2021
44e6eb5
Add component list
nicolasfara Oct 5, 2021
d5f384d
Improve CList section
nicolasfara Oct 6, 2021
11ba14d
Rewrite CListe sentences
nicolasfara Oct 6, 2021
5fc9e6c
Add World Entity and View sections
nicolasfara Oct 7, 2021
879f020
Add benchmark section
nicolasfara Oct 7, 2021
d6eabd2
Finish benchmark section
nicolasfara Oct 7, 2021
d0ba75f
Address review comments
nicolasfara Oct 7, 2021
a097f7b
Rewrite sentence
nicolasfara Oct 7, 2021
697ced0
Fix typo
nicolasfara Oct 7, 2021
da99a65
Improve benchmark sentence
nicolasfara Oct 7, 2021
2eb1d2e
Address review comments
nicolasfara Oct 7, 2021
ba32aff
Add hot method optimization to benchmark section
nicolasfara Oct 8, 2021
b80f333
Address review comments
nicolasfara Oct 8, 2021
a178830
Fix citation
nicolasfara Oct 8, 2021
fd7e9dd
Remove unused image
nicolasfara Oct 8, 2021
003a4da
Add benchmark result table
nicolasfara Oct 8, 2021
b7b66f7
Address review comments
nicolasfara Oct 8, 2021
b9687fc
Move CList into detail design section
nicolasfara Oct 8, 2021
434da9b
Fix formatting
nicolasfara Oct 8, 2021
77428aa
Move down problem section
nicolasfara Oct 8, 2021
f36d165
Refactor benchmark section
nicolasfara Oct 8, 2021
664dc64
Some improvements
nicolasfara Oct 8, 2021
6971e17
Remove unused file
nicolasfara Oct 8, 2021
b3b2893
Merge pull request #142 from nicolasfara/feature/nf-report-arch-design
nicolasfara Oct 9, 2021
4947fd3
Add first part of demo implementation
ndido98 Oct 8, 2021
e243064
Merge pull request #145 from nicolasfara/feature/ndd-demo-impl
giacomocavalieri Oct 9, 2021
28e9dda
Move sections structure
ndido98 Oct 9, 2021
19a0fe2
Add technologies section
ndido98 Oct 9, 2021
9f635b3
Merge pull request #147 from nicolasfara/feature/ndd-report-fixes
ndido98 Oct 9, 2021
b945c5e
Refine architecture section
ndido98 Oct 9, 2021
cf3ef4a
Add components container benchmark
ndido98 Oct 9, 2021
2895c61
Fix formatting
ndido98 Oct 9, 2021
2f952d8
Add math package
Oct 9, 2021
ef0041c
Detailed design first draft
Oct 9, 2021
b43f958
Implementation first draft
Oct 9, 2021
877af23
Add missing bib references
Oct 9, 2021
ffd74f8
Fix typo in file name
Oct 9, 2021
787001f
Add missing colon
Oct 9, 2021
3d47eee
Add example code
Oct 9, 2021
8b634ed
Address review comments
Oct 10, 2021
191ec0e
Move Deletable CList code
Oct 10, 2021
ed0a4c1
Address review comments
ndido98 Oct 10, 2021
79b21b2
Add AutoPauseSystem tests
nicolasfara Oct 10, 2021
ca5432c
Implemented AutoPauseSystem
nicolasfara Oct 10, 2021
82234dd
Use AutoPauseSystem into the demo
nicolasfara Oct 10, 2021
0a48b85
Fix typos
nicolasfara Oct 10, 2021
e1d026f
Add scaladoc
nicolasfara Oct 10, 2021
dbc5d16
Add demo development issue
Oct 10, 2021
5f373dc
Fix typo
nicolasfara Oct 10, 2021
a0ec620
Address review comments
ndido98 Oct 10, 2021
8c6debb
Add fuzzy matcher
nicolasfara Oct 10, 2021
64c1960
Merge pull request #150 from nicolasfara/feature/nf-auto-pause-system
giacomocavalieri Oct 10, 2021
900e96e
Merge pull request #148 from nicolasfara/feature/ndd-demo-architecture
ndido98 Oct 10, 2021
3500a29
Address review comment
Oct 10, 2021
47edb16
Fix error in image caption
giacomocavalieri Oct 11, 2021
4e08b40
Add detail design demo
nicolasfara Oct 10, 2021
626dfdd
Merge pull request #146 from nicolasfara/feature/gc-report-design
nicolasfara Oct 11, 2021
6bcb2cf
Merge pull request #149 from nicolasfara/feature/gc-nf-demo-detail-de…
nicolasfara Oct 11, 2021
a14fd4d
Add FSM to implementation section
nicolasfara Oct 9, 2021
2cafeaa
Add implementation demo section
nicolasfara Oct 10, 2021
06b419f
Remove trailing line
nicolasfara Oct 10, 2021
7a23786
Removed sentence
nicolasfara Oct 10, 2021
9a337ca
Rewrite sentence
nicolasfara Oct 10, 2021
38e9832
Rename file from .sc to .scala
nicolasfara Oct 10, 2021
5a4c94a
Address review comments
nicolasfara Oct 10, 2021
3e6f9ff
Address review comments
nicolasfara Oct 11, 2021
47def7c
Fix typo
nicolasfara Oct 11, 2021
6bb98d0
Fix junit interface
nicolasfara Oct 11, 2021
bfda7be
Add junit interface
nicolasfara Oct 11, 2021
a006208
Remove unused annotation
nicolasfara Oct 11, 2021
f72c012
Merge pull request #151 from nicolasfara/feature/nf-demo-implementation
giacomocavalieri Oct 11, 2021
a63eba0
Remove unused comment
nicolasfara Oct 11, 2021
b75f271
Remove unused import
nicolasfara Oct 11, 2021
cca5148
Add my section template
vitlinda Oct 8, 2021
745de69
Refactor retrospective
vitlinda Oct 10, 2021
1a2f6c8
Refactor DSL style
vitlinda Oct 10, 2021
1dc2e59
Add lv implementation section
vitlinda Oct 10, 2021
12d36ba
Add tecnologies used in demo section
vitlinda Oct 10, 2021
894ac97
Fix sentences and CI problems
vitlinda Oct 11, 2021
71b184f
Add some references
vitlinda Oct 11, 2021
0474aa0
Add demo requirements
vitlinda Oct 10, 2021
b361c53
Use correct keywords in core requirements
vitlinda Oct 10, 2021
f5c046d
Add enumeration
vitlinda Oct 10, 2021
6995b84
Fix some sentencies
vitlinda Oct 11, 2021
b67584e
Merge pull request #154 from nicolasfara/feature/nf-cross-run
nicolasfara Oct 11, 2021
e29a9fb
Fix latex render
vitlinda Oct 11, 2021
abb8de9
Add demo implementation
vitlinda Oct 11, 2021
b1c4051
Fix sentence
vitlinda Oct 11, 2021
5fdc227
Fix inconsistencies
vitlinda Oct 11, 2021
553c475
Merge pull request #153 from nicolasfara/feature/lv-demo-req
vitlinda Oct 11, 2021
e2ef0ac
Merge pull request #152 from nicolasfara/feature/lv-implementation
vitlinda Oct 12, 2021
edcff62
Add demo implementation section
Oct 12, 2021
8321f87
Address review comment
giacomocavalieri Oct 12, 2021
4013f2b
Address review comment
giacomocavalieri Oct 12, 2021
d92d3ff
Update README.md
nicolasfara Oct 12, 2021
430db82
Merge pull request #155 from nicolasfara/feature/gc-demo-implementation
ndido98 Oct 12, 2021
03e7954
Add javafx dependencies for all OS
nicolasfara Oct 12, 2021
66fd191
Fix readme version
nicolasfara Oct 12, 2021
c61d5f7
Simplify dependencies
nicolasfara Oct 12, 2021
47ae673
Merge pull request #157 from nicolasfara/feature/nf-fatjar
ndido98 Oct 12, 2021
86571bb
Add command alias in order to run the demo
nicolasfara Oct 12, 2021
8edc59e
Remove useless sections
vitlinda Oct 12, 2021
c31d79b
Fix typo and sentence structures
vitlinda Oct 12, 2021
dde2d0b
Update FSM diagram
nicolasfara Oct 12, 2021
936a190
Address suggestions
nicolasfara Oct 12, 2021
033d586
Fix typo
vitlinda Oct 12, 2021
8345104
Add diagrams
nicolasfara Oct 12, 2021
80a2831
Add demo diagram
nicolasfara Oct 13, 2021
b5c2e42
Fix typo
nicolasfara Oct 13, 2021
d3f8566
Add image
nicolasfara Oct 13, 2021
dadf8c3
Add Sonatype deployment
nicolasfara Oct 13, 2021
755134e
Add maven central badge
nicolasfara Oct 13, 2021
5f75867
Update Architecture diagram
nicolasfara Oct 13, 2021
0ea659b
Scale Architecture diagram
nicolasfara Oct 13, 2021
d11f674
Add from reference
vitlinda Oct 13, 2021
d86f39d
Merge branch 'feature/all-fix-report' of github.com:nicolasfara/ecsca…
vitlinda Oct 13, 2021
21776d5
Add Sequence diagram and formatting
nicolasfara Oct 13, 2021
3421929
Merge branch 'feature/all-fix-report' of github.com:nicolasfara/ecsca…
nicolasfara Oct 13, 2021
a46d840
Add missing figures
Oct 13, 2021
2c44341
Fix figures
nicolasfara Oct 13, 2021
ad0c58b
General fixes
nicolasfara Oct 13, 2021
20c6bd0
Add spaced before every citation
Oct 14, 2021
aa8c3e6
Change verb tenses
Oct 14, 2021
c46ba30
Add full stop after every caption
Oct 14, 2021
bd507f2
Move colon in lists
Oct 14, 2021
90986d3
Add facade in detailed design
vitlinda Oct 14, 2021
0023432
Merge branch 'feature/all-fix-report' of github.com:nicolasfara/ecsca…
vitlinda Oct 14, 2021
4ff011a
Change Component to monospaced
Oct 14, 2021
6418b6a
Remove cursive
Oct 14, 2021
9851f17
Change monospaced text with italian version
Oct 14, 2021
fc07327
Use coherent rule for english terms
Oct 14, 2021
239431b
Fix backlog
Oct 14, 2021
a1dfdea
Fix implementation requirements
Oct 14, 2021
6eba98a
Add citations
Oct 14, 2021
ad4d86f
Change Deletable CList paragraph
Oct 14, 2021
8f592eb
Fix benchmark section incipit
Oct 14, 2021
dc502d1
Remove ' from long numbers
Oct 14, 2021
f4ae70f
Add game loop description
Oct 14, 2021
63b5c94
Add conclusion
Oct 14, 2021
fcb6ff7
Add demo architecture diagram
nicolasfara Oct 14, 2021
40e59cf
Move CLists to implementation
Oct 14, 2021
5552e24
Merge branch 'feature/all-fix-report' of github.com:nicolasfara/ecsca…
Oct 14, 2021
f57c3ee
Reference new diagram
nicolasfara Oct 14, 2021
884a1e4
Add Demo diagram
nicolasfara Oct 14, 2021
6b69748
Fix implementation broken reference
Oct 14, 2021
0a01cf2
Add new design Figure
Oct 14, 2021
253984e
Revert to correct Demo image
nicolasfara Oct 14, 2021
564232d
Add facade image
nicolasfara Oct 14, 2021
2491a5e
Add facade image
Oct 14, 2021
73dee1d
Update sequence diagram
nicolasfara Oct 14, 2021
dee52be
Miscellaneous fixes
ndido98 Oct 14, 2021
98143b7
Fix From diagram
nicolasfara Oct 14, 2021
34b7302
Merge pull request #156 from nicolasfara/feature/all-fix-report
nicolasfara Oct 14, 2021
bd393bc
Merge branch 'master' into develop
nicolasfara Oct 14, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
matrix:
os: [ubuntu-latest]
scala: [3.0.1]
java: [adopt@1.8, adopt@1.11, adopt@1.16]
java: [adopt@1.11, adopt@1.16]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
Expand All @@ -33,7 +33,7 @@ jobs:
fetch-depth: 0

- name: Setup Java and Scala
uses: olafurpg/setup-scala@v10
uses: olafurpg/setup-scala@v13
with:
java-version: ${{ matrix.java }}

Expand All @@ -53,15 +53,17 @@ jobs:
run: sbt ++${{ matrix.scala }} githubWorkflowCheck

- name: Lint check with scalafmt
run: sbt ++${{ matrix.scala }} scalafmtCheck
run: sbt ++${{ matrix.scala }} scalafmtCheckAll

- name: Tests
run: sbt ++${{ matrix.scala }} 'core / test'
run: sbt ++${{ matrix.scala }} test

- name: Generate JaCoCo report
if: ${{ matrix.java }} == 'adopt@1.11' && ${{ matrix.scala }} == '3.0.1' && github.event_name != 'pull_request'
run: sbt ++${{ matrix.scala }} 'core / jacoco'

- name: Publish coverage to codecov
if: ${{ matrix.java }} == 'adopt@1.11' && ${{ matrix.scala }} == '3.0.1' && github.event_name != 'pull_request'
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down Expand Up @@ -92,7 +94,7 @@ jobs:
matrix:
os: [ubuntu-latest]
scala: [3.0.1]
java: [adopt@1.8]
java: [adopt@1.11]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
Expand All @@ -101,7 +103,7 @@ jobs:
fetch-depth: 0

- name: Setup Java and Scala
uses: olafurpg/setup-scala@v10
uses: olafurpg/setup-scala@v13
with:
java-version: ${{ matrix.java }}

Expand Down Expand Up @@ -134,6 +136,9 @@ jobs:
args: '-output-format=pdf -file-line-error -synctex=1 -halt-on-error -interaction=nonstopmode -shell-escape'
working_directory: doc

- name: Create FatJar for the demo
run: sbt ++${{ matrix.scala }} 'demo / assembly'

- name: Release to Sonatype
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
Expand All @@ -153,4 +158,4 @@ jobs:
core/target/scala-3.0.1/*.jar
core/target/scala-3.0.1/*.pom
demo/target/scala-3.0.1/ECScalaDemo.jar
doc/ecscala-report.pdf
doc/ecscala-report.pdf
2 changes: 1 addition & 1 deletion .github/workflows/clean.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ jobs:
printf "Deleting '%s' #%d, %'d bytes\n" $name ${ARTCOUNT[$name]} $size
ghapi -X DELETE $REPO/actions/artifacts/$id
done
done
done
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# ECScala
General-purpose ECS Scala framework
An ECS Scala framework

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Maven Central](https://img.shields.io/maven-central/v/dev.atedeg/ecscala_3)](https://search.maven.org/artifact/dev.atedeg/ecscala_3)
[![GitHub release](https://img.shields.io/github/release/nicolasfara/ecscala.svg)](https://github.com/nicolasfara/ecscala/releases/)
![example workflow](https://github.com/nicolasfara/ecscala/workflows/CI/badge.svg)
[![codecov](https://codecov.io/gh/nicolasfara/ecscala/branch/develop/graph/badge.svg?token=0XZ4XF71AY)](https://codecov.io/gh/nicolasfara/ecscala)
Expand All @@ -10,7 +11,7 @@ General-purpose ECS Scala framework
## Getting Started

```scala
libraryDependencies += "dev.atedeg" %% "ecscala" % "0.1.0"
libraryDependencies += "dev.atedeg" %% "ecscala" % "0.2.1"
```

## Usage
Expand All @@ -29,7 +30,7 @@ object AnObject extends ECScalaDSL {
Position(1, 2) &: Velocity(3, 4) &: Gravity(9.8)
}

entity1 + Position(3, 6)
entity1 += Position(3, 6)
}
```

Expand Down
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))
}
}
}
38 changes: 0 additions & 38 deletions benchmarks/src/main/scala/ecscala/MapBenchmark.scala

This file was deleted.

8 changes: 4 additions & 4 deletions benchmarks/src/main/scala/ecscala/SystemBenchmark.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package ecscala

import dev.atedeg.ecscala.util.types.given
import dev.atedeg.ecscala.{ &:, CNil, System, World }
import dev.atedeg.ecscala.given
import dev.atedeg.ecscala.{ &:, CNil, IteratingSystem, World }
import ecscala.utils.{ JmhSettings, Position, Velocity }
import org.openjdk.jmh.annotations.{ Benchmark, Setup }

Expand All @@ -11,10 +11,10 @@ class SystemBenchmark extends JmhSettings {

@Setup
def init: Unit = {
world.addSystem[Position &: Velocity &: CNil]((_, comps, _) => {
world.addSystem(IteratingSystem[Position &: Velocity &: CNil]((_, comps, _) => {
val Position(x, y) &: Velocity(v1, v2) &: CNil = comps
Position(x + 1, y) &: Velocity(v1, v2)
})
}))
}

@Benchmark
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/src/main/scala/ecscala/ViewBenchmark.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package ecscala

import dev.atedeg.ecscala.util.types.given
import dev.atedeg.ecscala.given
import dev.atedeg.ecscala.{ &:, CNil, Component, World }
import ecscala.utils.{ JmhSettings, Position, Velocity }
import org.openjdk.jmh.annotations.Benchmark
Expand All @@ -12,6 +12,6 @@ class ViewBenchmark extends JmhSettings {
@Benchmark
def viewIterationBenchmark: Unit = {
val view = world.getView[Position &: Velocity &: CNil]
view foreach (_.head.addComponent(Position(2, 3)))
view foreach (_.head setComponent Position(2, 3))
}
}
16 changes: 8 additions & 8 deletions benchmarks/src/main/scala/ecscala/utils/JmhSettings.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package ecscala.utils

import dev.atedeg.ecscala.util.types.given
import dev.atedeg.ecscala.given
import dev.atedeg.ecscala.{ &:, CNil, System, World }
import org.openjdk.jmh.annotations.{
Benchmark,
Expand All @@ -22,22 +22,22 @@ import org.openjdk.jmh.annotations.{
import java.util.concurrent.TimeUnit

@State(Scope.Thread)
@BenchmarkMode(Array(Mode.AverageTime))
@BenchmarkMode(Array(Mode.SampleTime))
@Threads(1)
@Fork(1)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
@Warmup(iterations = 10, time = 1, timeUnit = TimeUnit.SECONDS)
@Measurement(iterations = 5, time = 10, timeUnit = TimeUnit.SECONDS)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@Warmup(iterations = 50, time = 100, timeUnit = TimeUnit.MILLISECONDS)
@Measurement(iterations = 100, time = 100, timeUnit = TimeUnit.MILLISECONDS)
class JmhSettings {

@Param(Array("1024", "2048", "4096"))
@Param(Array("1024", "2048", "4096", "10000"))
var nEntities: Int = _
val world: World = World()

@Setup
def setup: Unit = {
val entities = (0 until nEntities) map (_ => world.createEntity())
entities foreach (_.addComponent(Position(1, 2)))
entities foreach (_.addComponent(Velocity(3, 4)))
entities foreach (_ setComponent Position(1, 2))
entities foreach (_ setComponent Velocity(3, 4))
}
}
Loading