Package-level declarations

Types

Link copied to clipboard
typealias Condition = () -> Boolean

Provides a callback for a condition that must return a Boolean.

Link copied to clipboard
class ConditionalDescription(trueDescription: String, falseDescription: String, condition: Condition) : Description

Provides a conditional description of an object. Returns the trueDescription if the condition returns true, else the falseDescription.

Link copied to clipboard
open class Description(description: String)

Provides a description of an object, specified by description.

Link copied to clipboard

Provides a simple contract for any object that can be examined.

Link copied to clipboard
abstract class ExaminableObject : Examinable

Provides a base implementation for examinable objects.

Link copied to clipboard
typealias Examination = (examinationRequest: ExaminationRequest) -> ExaminationResult

Provides a lambda signature for handling an examinationRequest that must return a ExaminationResult.

Link copied to clipboard
data class ExaminationRequest(val examinable: Examinable, val scene: ExaminationScene)

Represents a request to examine an examinable in a scene.

Link copied to clipboard
data class ExaminationResult(val description: String) : Result

The result of an examination.

Link copied to clipboard
data class ExaminationScene(val examiner: Character, val room: Room)

Represents a scene that an examination occurs in with a examiner and a room.

Link copied to clipboard
class Identifier(val name: String)

Provides functionality that can be used to identify an object with a specified name.

Link copied to clipboard
class Item(val identifier: Identifier, var description: Description, var takeable: Boolean = false, var interaction: Interaction = defaultInteraction) : ExaminableObject, InteractWithItem

Provides an item that can appear in a Game. The item must have a identifier and a description. Optionally the item can be made takeable by setting takeable to true, and an interaction to define how this interacts with various InteractWithItem specified with interaction.

Link copied to clipboard
interface PlayerVisible

Provides a simple contract for any object that can be visible to a player.

Link copied to clipboard
data class Size(val width: Int, val height: Int)

Represents a 2-dimensional size with a width and a height.