| Path: | lib/mues/environment.rb (CVS) |
| Last Update: | Sat Aug 18 22:54:10 -0700 2007 |
This is an abstract base class for MUES environment objects. Environments are objects which contain the main context of interaction between Users and other objects, as well as the expression of the rules of that interaction. It is the Universe of Discourse in which the interaction takes place. In a game context, for example, the Environment contains the logic for all gameplay, including rules for movement about a space, class definitions for in-game objects, and a function library which can be used in the expression of those objects to interact with the containing server and the world itself.
require 'mues/environment' # Create a new environment object environment = MUES::Environment::new( "Faerith" ) # Get the list of roles available to the user roles = environment.getAvailableRoles( aUser ) # After determining the desired role, get an IOEventFilter that can be # inserted into the user's IOEventStream to allow interaction with the # Environment and insert it. proxy = environment.getParticipantProxy( aUser, roles[0] ) aUser.ioEventStream.addFilters( proxy )
Subclasses are required to provide implementations of the following methods:
If the default shell commands for interacting with environments (server/shellCommands/environments.cmd) are used, environments should also implement the following methods:
Different modes of connection to an Environment can be created by modifying or replacing the commands for interacting with them.
$Id: environment.rb 1206 2004-05-09 21:25:11Z deveiant $
Copyright (c) 2000-2003 The FaerieMUD Consortium. All rights reserved.
This module is free software. You may use, modify, and/or redistribute this software under the terms of the Perl Artistic License. (See language.perl.com/misc/Artistic.html)
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.