The Mind is a key part to Interactives since the Mind is the
class that handles the interaction between the mud and a controller.
Herein is the functionality for handling controller-created input events
and controller-created NAWS events and sending those events to the
proper processors.
Methods
|
|
|
|
heartbeat
|
heartbeat ( self )
This provides a heartbeat.
Override this. |
|
popInputProcessor
|
popInputProcessor ( self )
Pops an input processor and a prompt handler off the stack. |
|
popNawsProcessor
|
popNawsProcessor ( self )
Pops a Naws processor off the stack in order to no
longer receive Naws (window resize) events. Used in conjunction with pushNawsProcessor .
|
|
processCommand
|
processCommand ( self, input )
This is the default command processor. If there isn't anything
in the self._processessingMethods list, then this is the
processor that handles the input. arguments:
-
input
- (string) input from the controller
|
|
processInput
|
processInput ( self, input )
Handles sending the input to the current input processor.
arguments:
-
input
- (string) input from the controller
|
|
processNawsEvent
|
processNawsEvent ( self )
This processes Naws events by passing it onto the
first processor in the _processingNawsMethods array. The only time you'd want to process Naws events is
if you were an editor in character mode and need to
refresh your screen because of the resizing of the
client's window area.
|
|
prompt
|
prompt ( self )
This is the default prompt method. |
|
pushInputProcessor
|
pushInputProcessor (
self,
processingMethod,
promptMethod,
)
Pushes a new method for handling input and a method for handling
prompts onto the input processor stack. arguments:
-
processingMethod
- (function) the method to handle input processing
-
promptMethod
- (function) the method to handle prompts
|
|
pushNawsProcessor
|
pushNawsProcessor ( self, processingMethod )
Pushes a Naws processor on the stack in order to
handle Naws (window resize) events. Not for the feint of heart.
arguments:
-
processingMethod
- (function) the function that
should now handle NAWS events
NAWS HANDLING
|
|
rawwrite
|
rawwrite ( self, message )
Raw writes a message to the controller.
Override this. |
|
setInteractive
|
setInteractive ( self, controlledInteractive )
Sets the interactive for this mind.
see mudlib.living.Interactive
arguments:
-
controlledInteractive
- (mudlib.living.Interactive) the interactive
this mind is controlling
|
|
write
|
write ( self, message )
Writes a message to the controller.
Override this. |