Skip to content

Commit

Permalink
Cleanup components
Browse files Browse the repository at this point in the history
  • Loading branch information
jobe-m committed Mar 18, 2024
1 parent 7898dd1 commit dc65b74
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ import kotlinx.serialization.Serializable
/**
* Currently this is used to get the layout details for an Entity from the asset object.
* The asset object is configured from GameModel.
*
* Precondition:
* The component hook function needs the view for the entity.
* Thus, [DrawableComponent] and [PositionShapeComponent] needs to be added before adding LayoutComponent to the entity.
*/
@Serializable
@SerialName("Layout")
Expand All @@ -25,29 +21,4 @@ data class LayoutComponent(
) : Component<LayoutComponent> {
override fun type(): ComponentType<LayoutComponent> = LayoutComponent
companion object : ComponentType<LayoutComponent>()

/**
* This function is invoked when a [LayoutComponent] gets added to an entity.
*/
override fun World.onAdd(entity: Entity) {
/*
println("Layout: onAdd (id: ${entity.id})")
if ()
val view = KorgeViewCache[entity]
if (centerX) view.centerXOnStage()
if (centerY) view.centerYOnStage()
if (entity has PositionShapeComponent) {
val positionShapeComponent = entity[PositionShapeComponent]
positionShapeComponent.x = view.x + offsetX // view is needed otherwise the Sprite System will not take possible center values from above
positionShapeComponent.y = view.y + offsetY
}
*/
}

override fun World.onRemove(entity: Entity) {
}

}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ internal val internalModule = SerializersModule {
}
// Register tags (components without properties)
polymorphic(UniqueId::class) {
// subclass(VisibleTag::class, VisibleTag.serializer())
// subclass(VisibleTag::class)
}

// Data class hierarchy used for AnimationScript component
Expand Down

0 comments on commit dc65b74

Please sign in to comment.