Table of Contents

Class: ActionManager mudlib/living.py

Skeleton ActionManager

Base Classes   
MudObject
Methods   
__init__
addAction
getCommands
notifyFail
processAction
processCommandAction
processCommandAlias
removeAction
  __init__ 
__init__ ( self )

  addAction 
addAction (
        self,
        actionString,
        function,
        )

Binds an action string to a function fo this action manager.

arguments:

actionString
(string) the command
function
(function) the function to handle it
  getCommands 
getCommands ( self )

Gets the list of commands this action manager is managing.

returns:

(list of strings)

  notifyFail 
notifyFail ( self,  message )

Sets the notification of failure message.

When a command starts processing, it sets the notifyFail message so that if it fails, the user gets an idea of what's wrong. This could be a syntax issue or even an issue of them trying to apply a command to an object that can't be applied.

arguments:

message
(string) the failure message
  processAction 
processAction (
        self,
        actionString,
        arguments,
        rawinput,
        )

Processes an action.

arguments:

actionString
(string) the first word of what they typed
arguments
(string) everything after the first word with \; converted to ;
rawinput
(string) the entire string unadjusted
  processCommandAction 
processCommandAction (
        self,
        actionString,
        arguments,
        rawinput,
        )

Processes this action handling failure messages and the like.

returns:

(int) 1 if it was handled and processed, 0 if it wasn't and printed a failure string.

  processCommandAlias 
processCommandAlias (
        self,
        actionString,
        arguments,
        rawinput,
        )

Processes a command alias.

First unaliases the command and then processes the command.

arguments:

actionString
(string) the first word of what they typed
arguments
(string) everything after the first word with \; converted to ;
rawinput
(string) the entire string unadjusted
  removeAction 
removeAction (
        self,
        actionString,
        function,
        )

Removes an action from this manager.

arguments:

actionString
(string) the command to remove
function
(function) the function that handles the command to remove

Table of Contents

This document was automatically generated on Thu Jan 24 08:57:43 2002 by HappyDoc version 2.0