PlayableCharacter

class PlayableCharacter(val identifier: Identifier, var description: Description, val canConverse: Boolean = true, items: List<Item> = emptyList()) : Character

A playable character with the specified identifier and description and items. If the playable character can converse with a Converser should be set to true, else false.

Constructors

Link copied to clipboard
constructor(identifier: String, description: String, canConverse: Boolean = true, items: List<Item> = emptyList())

A playable character with the specified identifier and description and items. If the playable character can converse with a Converser should be set to true, else false.

constructor(identifier: Identifier, description: Description, canConverse: Boolean = true, items: List<Item> = emptyList())

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
val canConverse: Boolean = true
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

Specifies how this Character interacts with various Item.

Link copied to clipboard

Determines if this Character is alive.

Link copied to clipboard
open override var isPlayerVisible: Boolean

Returns true if visible to the player, else false.

Link copied to clipboard

This characters Item.

Functions

Link copied to clipboard
fun acquireItem(item: Item)

Acquire the specified item.

Link copied to clipboard
fun decquireItem(item: Item)

Dequire the specified item.

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
fun findItem(itemName: String, includeInvisibleItems: Boolean = false): Item?

Find an return an item from the specified itemName. When includeInvisibleItems is set to true even Item that have been marked as invisible to the player will be inspected. If the Character does not have the Item then null wil be returned.

Link copied to clipboard
fun give(item: Item, character: Character): Boolean

Give a specified item to a specified character. This will return true if the transaction was successful, else false.

Link copied to clipboard
fun hasItem(item: Item, includeInvisibleItems: Boolean = false): Boolean

Determine if this Character has the specified item. When includeInvisibleItems is set to true even Item that have been marked as invisible to the player will be inspected.

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

Interact with the specified item to obtain a InteractionResult.

Link copied to clipboard
fun kill()

Kill this Character.

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

Trigger this PlayableCharacter to use the specified item on the specified target.