Skip to content

Commit

Permalink
Small addition to GearyType
Browse files Browse the repository at this point in the history
  • Loading branch information
0ffz committed Aug 7, 2022
1 parent dc0b816 commit b385351
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ public value class GearyEntity(public val id: GearyEntityId) {
globalContext.engine.addComponentFor(this, Relation.of<K?>(target).id, noEvent)
}

/** Removes a relation key key of type [K] and value of type [V]. */
/** Removes a relation key of type [K] and value of type [V]. */
public inline fun <reified K : GearyComponent, reified T : GearyComponent> removeRelation(): Boolean {
return removeRelation<K>(component<T>())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ public value class GearyType private constructor(
return GearyType(arr)
}

public operator fun plus(other: GearyType): GearyType {
return GearyType(inner.plus(other.inner))
}

public operator fun minus(id: GearyComponentId): GearyType {
val removeAt = binarySearch(id)
if (removeAt < 0) return this
Expand Down

0 comments on commit b385351

Please sign in to comment.