Skip to content

Commit

Permalink
Implementing AggregateDsl
Browse files Browse the repository at this point in the history
  • Loading branch information
michaellifTelus committed Oct 22, 2022
1 parent 2faf81e commit 13363d7
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ abstract class Aggregate(private val aggregateName: String) {

abstract fun onCreate(pass: Pass)

protected fun <T : Aggregate> initAggregate(aggregate: T, init: T.() -> Unit): T {
protected fun <T : Aggregate> addAggregate(aggregate: T, init: T.() -> Unit): T {
aggregate.parent = this
children.add(aggregate)
aggregate.randomSeed = Random(aggregate.getPath().hashCode().toLong()).nextLong()
aggregate.onConstruct()
aggregate.init()
return aggregate
}
Expand Down

0 comments on commit 13363d7

Please sign in to comment.