AdventureDraft Docs
Fall 2026
API

# Action

o1.adventure.draft.Action
class Action(`input`: String)

The class `Action` represents actions that a player may take in a text adventure game. `Action` objects are constructed on the basis of textual commands and are, in effect, parsers for such commands. An action object is immutable after creation.

## Parameters

input

  a textual in-game command such as “go east” or “rest”

## Attributes

Graph
Supertypes
  class Object
  trait Matchable
  class Any

## Members list

### Value members

#### Concrete methods

def execute(`actor`: Player): Boolean

Causes the given player to take the action represented by this object, assuming that the command was understood. Returns ``false`if the command was not recognized and true` otherwise.

Causes the given player to take the action represented by this object, assuming that the command was understood. Returns ``false`if the command was not recognized and true` otherwise.

## Attributes

override def toString: String

Returns a textual description of the action object, for debugging purposes.

Returns a textual description of the action object, for debugging purposes.

## Attributes

Definition Classes
  Any