Skip to content

Commit e2277b3

Browse files
committed
docs: Fix instances of documentation referring to inline (value) classes where they are no longer used. Closes #111
1 parent a224c96 commit e2277b3

4 files changed

Lines changed: 12 additions & 8 deletions

File tree

addons/geary-prefabs/src/com/mineinabyss/geary/prefabs/PrefabKey.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ import com.mineinabyss.geary.prefabs.serializers.PrefabKeySerializer
66
import kotlinx.serialization.Serializable
77

88
/**
9-
* An inline class which represents a key build from a [namespace] and [key], separated
9+
* Represents a key build from a [namespace] and [key], separated
1010
* by a '`:`' symbol.
1111
*/
1212
@ConsistentCopyVisibility
1313
@Serializable(with = PrefabKeySerializer::class)
14-
// We don't make this a value class since calculating substring is pretty expensive compared to one new object instantiation
14+
// Note: We don't make this a value class since calculating substring is pretty expensive compared to one new object instantiation
1515
data class PrefabKey private constructor(val namespace: String, val key: String) {
1616
val full get() = "$namespace:$key"
1717

geary-core/src/com/mineinabyss/geary/datatypes/Entity.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package com.mineinabyss.geary.datatypes
33
import com.mineinabyss.geary.annotations.optin.DangerousComponentOperation
44
import com.mineinabyss.geary.components.EntityName
55
import com.mineinabyss.geary.datatypes.family.family
6-
import com.mineinabyss.geary.engine.Engine
76
import com.mineinabyss.geary.helpers.NO_COMPONENT
87
import com.mineinabyss.geary.helpers.component
98
import com.mineinabyss.geary.helpers.componentId
@@ -28,11 +27,12 @@ import kotlin.reflect.KClass
2827
typealias GearyEntity = Entity
2928

3029
/**
31-
* A wrapper around [EntityId] that gets inlined to just a long (no performance degradation since no boxing occurs).
30+
* A combination of [EntityId] with a [world] it belongs to.
3231
*
33-
* Provides some useful functions, so we aren't forced to go through [Engine] every time we want to do some things.
32+
* Provides some useful functions for reading and writing data associated with this entity, as well as validating
33+
* matching [world] instances when multiple entities are involved (see [requireSameWorldAs]).
3434
*/
35-
//TODO add require checks for entities across different worlds
35+
//TODO call requireSameWorldAs for all functions involving other Entity instances.
3636
class Entity(val id: EntityId, val world: Geary) {
3737
val comp get() = world.components
3838

geary-core/src/com/mineinabyss/geary/datatypes/EntityIdArray.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ fun MutableLongList.toEntityArray(world: Geary): EntityArray {
1313
return EntityArray(world, ULongArray(size) { get(it).toULong() })
1414
}
1515

16+
/**
17+
* An array of [EntityId]s with an associated [world].
18+
* Avoids string boxed [GearyEntity] instances for each entity, with helpers to completely avoid boxing like [forEachId].
19+
*/
1620
class EntityArray(
1721
val world: Geary,
1822
val ids: EntityIdArray,

geary-core/src/com/mineinabyss/geary/datatypes/EntityType.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import com.mineinabyss.geary.helpers.readableString
44

55

66
/**
7-
* An inlined class used for tracking the components an entity/archetype has.
7+
* Immutable array of [ComponentId]s used to represent the 'type' of an [com.mineinabyss.geary.engine.archetypes.Archetype].
88
*
99
* It provides fast (no boxing) functions backed by FastUtil sorted sets to do operations with [ComponentId]s.
1010
*/
1111
class EntityType private constructor(
1212
@PublishedApi
13-
internal val inner: ULongArray
13+
internal val inner: ULongArray,
1414
) {
1515
constructor() : this(ULongArray(0))
1616

0 commit comments

Comments
 (0)