Skip to content

Commit

Permalink
Tidy of logging in example
Browse files Browse the repository at this point in the history
  • Loading branch information
ben_pollard committed Nov 5, 2023
1 parent 821cf5a commit 8458a28
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@ object Main : Logging {
fun main(args: Array<String>) {
val sceneListener = object : SceneListener {
override fun enter(scene: Scene) {
println("Entered ${scene.type}")
println("Entered scene: ${scene.name}")
}

override fun exit(scene: Scene) {
println("Exited ${scene.type}")
println("Exited scene: ${scene.name}")
}
}

val chapterListener = object : ChapterListener {
override fun enter(chapter: Chapter) {
ConsoleListenerProvider.clear()
println("Entered ${chapter.name}")
println("Started chapter: ${chapter.name}")
}

override fun exit(chapter: Chapter) {
println("Exited ${chapter.name}")
println("Ended chapter: ${chapter.name}")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import com.github.benpollarduk.ktvn.logic.structure.StepResult
import com.github.benpollarduk.ktvn.logic.structure.Story
import com.github.benpollarduk.ktvn.logic.structure.Story.Companion.story
import com.github.benpollarduk.ktvn.logic.structure.steps.Choice.Companion.choice
import com.github.benpollarduk.ktvn.logic.structure.steps.End.Companion.end
import com.github.benpollarduk.ktvn.logic.structure.steps.Conditional.Companion.conditional
import com.github.benpollarduk.ktvn.logic.structure.steps.End.Companion.end
import com.github.benpollarduk.ktvn.logic.structure.steps.Then.Companion.next

/**
Expand All @@ -33,7 +33,7 @@ public class ExampleCreator(private val listeners: ListenerProvider) {
listeners.narrates,
listeners.asks,
listeners.acknowledges,
listeners.answers,
listeners.answers
)

private fun createCharacter(name: String): Character {
Expand All @@ -43,7 +43,7 @@ public class ExampleCreator(private val listeners: ListenerProvider) {
listeners.emotes,
listeners.asks,
listeners.acknowledges,
listeners.answers,
listeners.answers
)
}

Expand All @@ -56,7 +56,7 @@ public class ExampleCreator(private val listeners: ListenerProvider) {
scene layout createLayout { }
scene steps listOf(
next { narrator narrates "Many years have passed since Michel moved in to the mansion." },
next { narrator narrates "Although Michel has remained amicable, the witch, Morgana, has not." },
next { narrator narrates "Although Michel has remained amicable, the witch, Morgana, has not." }
)
}
}
Expand Down Expand Up @@ -124,7 +124,7 @@ public class ExampleCreator(private val listeners: ListenerProvider) {
next { narrator narrates "And that was the end of that!" },
end {
it number 0
},
}
)
}
}
Expand Down

0 comments on commit 8458a28

Please sign in to comment.