Skip to content

Step

data class Step(
val tile: Tile3,
val type: StepType,
val detectCollision: Boolean = true
)
Example
fun nextSteps(npc: Npc, path: List<Tile3>) {
val moving = npc.findComponent<Moving>() ?: Moving().also { npc.addComponent(it) }
val steps = path.map { Step(it, StepType.Normal) }
steps.forEach { moving.addStep(it.tile, it.type, it.detectCollision) }
}
val tile: Tile3
val type: StepType
val detectCollision: Boolean