Item

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.

Constructors

Link copied to clipboard
constructor(identifier: String, description: String, takeable: Boolean = false, interaction: Interaction = defaultInteraction)

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 a interaction to define how this interacts with various InteractWithItem specified with interaction.

constructor(identifier: Identifier, description: Description, takeable: Boolean = false, interaction: Interaction = defaultInteraction)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val attributes: AttributeManager

An AttributeManager that provides management of all Attribute for this Examinable.

Link copied to clipboard
open override var commands: List<CustomCommand>

A list of CustomCommand that this Examinable provides.

Link copied to clipboard
open override var description: Description

A Description that describes this object.

Link copied to clipboard

Provides a callback for handling examination of this object.

Link copied to clipboard
open override var identifier: Identifier

An Identifier that can be used to identify this object.

Link copied to clipboard
Link copied to clipboard
open override var isPlayerVisible: Boolean

Returns true if visible to the player, else false.

Link copied to clipboard

Returns true if the Item can be taken by the PlayableCharacter.

Link copied to clipboard

Functions

Link copied to clipboard
open override fun examine(scene: ExaminationScene): ExaminationResult

Examine this object to obtain an ExaminationResult. The scene that the examination occurs in must be specified.

Link copied to clipboard
open override fun interact(item: Item): InteractionResult

Interact with the specified item.

Link copied to clipboard
fun morph(item: Item)

Morph this Item in to the specified item.

Link copied to clipboard
open override fun toString(): String