Class Index | File Index

Classes


Class com.jiffeegames.Places

A Places object defines the API to create, describe, and connect places, as well as the commands used to look at them and to move around among them.
Defined in: jiffee-places.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Create a Places object.
Method Summary
Method Attributes Method Name and Description
 
add(place)
Create a noun of type "place" with the given name.
 
connect(place, direction, base)
Connect two places, in both directions.
 
describe(pName, whereAmI, lookAround)
Create a new place and give it a long description.
<private>  
doGoCmd_(event)
Command handler for the "go" command.
<private>  
Command handler for the "look" command.
<private>  
Command handler for the "where" command.
<static>  
com.jiffeegames.Places.es()
Set the language to Spanish.
 
here()
Return the player's current location.
 
init(locate, language)
<private>  
performMoveTo_(action, event)
Handle actions of the form "MOVE thing-name TO place-name", where thing-name defaults to "player" if not specified, and place-name can be "HERE".
Class Detail
com.jiffeegames.Places()
Create a Places object. The typical call is:
var places = new com.jiffeegames.Places();
Requires:
com.jiffeegames.Persons
Method Detail
{void} add(place)
Create a noun of type "place" with the given name.
Parameters:
{String} place
The name to use.

{void} connect(place, direction, base)
Connect two places, in both directions. The typical call is:
places.connect("dining room", "north", "kitchen");
which places the dining room north of the kitchen.
Parameters:
{String} place
The name of the place you are positioning.
{String} direction
The position of the place, stated as a direction relative to the base location.
{String} base
The name of the base location.

{void} describe(pName, whereAmI, lookAround)
Create a new place and give it a long description. The typical call is:
places.describe("porch", 
                "You're on the porch.",
                "You are standing on a spacious porch blah blah");
Parameters:
{String} pName
The name of the place you are describing.
{String} whereAmI
(optional) The response to "where am i".
{String} lookAround
The long description of the place.

<private> {void} doGoCmd_(event)
Command handler for the "go" command. Moves the player in a compass direction, or up/down/inside/outside.
Parameters:
{Object} event
The event that triggered the call.

<private> {void} doLookAroundCmd_(event)
Command handler for the "look" command. Does a long detailed look around the current location.
Parameters:
{Object} event
The event that triggered the call.

<private> {void} doWhereAmICmd_(task)
Command handler for the "where" command. Shows a quick, terse indication of where the player is.
Parameters:
{Object} task
The event that triggered the call.

<static> {void} com.jiffeegames.Places.es()
Set the language to Spanish.

{String} here()
Return the player's current location.
Returns:
The name of the Place where the player is now.

init(locate, language)
Parameters:
locate
language

<private> {boolean} performMoveTo_(action, event)
Handle actions of the form "MOVE thing-name TO place-name", where thing-name defaults to "player" if not specified, and place-name can be "HERE".
Parameters:
action
event
Returns:
true if this performer handles this action.

Documentation generated by JsDoc Toolkit 2.3.2 on Sun Jul 25 2010 13:49:31 GMT-0700 (PDT)