Class Index | File Index

Classes


Class com.jiffeegames.Props

A Props object defines the basic commands to create and manipulate props, i.e. portable things.
Defined in: jiffee-props.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Create a Props object.
Method Summary
Method Attributes Method Name and Description
 
add(name)
Create a noun of type "prop" with the given name.
 
carried(prop)
Test a prop to see if it is being carried.
 
describe(name, location, lookAround, inventory, examine)
Create a new prop and give it a long description and initial location.
<private>  
Command handler for the "examine" command.
<private>  
doGetCmd_(event)
Command handler for the "get" command.
<private>  
Command handler for the "put" command.
<private>  
doLookCmd_(event)
Display a list of the items which are present (but not carried) in the current location.
<private>  
doPutCmd_(event)
Command handler for the "put" command.
<static>  
com.jiffeegames.Props.es()
Define the Spanish input and output.
 
init(locate, language)
 
present(prop)
Test a prop to see if it is present.
 
reachable(prop)
Test a prop to see if it is reachable.
<private>  
Decide how to describe a prop in the current location.
<private>  
Decide how to describe the player carrying a prop.
Class Detail
com.jiffeegames.Props()
Create a Props object. The typical call is:
var props = new com.jiffeegames.Props();
Method Detail
{void} add(name)
Create a noun of type "prop" with the given name.
Parameters:
{String} name
The name to use.

{bool} carried(prop)
Test a prop to see if it is being carried.
Parameters:
{String} prop
The name of the prop being tested.
Returns:
true if the prop is being carried, else returns false.

{void} describe(name, location, lookAround, inventory, examine)
Create a new prop and give it a long description and initial location. The typical call is:
props.describe("ball", "grassy field",
"This is a standard-sized black-and-white soccer ball,
and it feels like it is pumped up to the regulation pressure.");
Parameters:
{String} name
The name of the prop you are describing.
{String} location
The initial location of the prop.
{String} lookAround
(optional) The string that describes the prop when present.
{String} inventory
(optional) The string that describes the prop when carried.
{String} examine
The string the describes the prop when examined.

<private> {void} doExamineCmd_(event)
Command handler for the "examine" command. Displays a detailed description of the specified item.
Parameters:
{Object} event
The event that triggered the call.

<private> {void} doGetCmd_(event)
Command handler for the "get" command. Picks up the specified item, if possible, and displays confirmation.
Parameters:
{Object} event
The event that triggered the call.

<private> {void} doInventoryCmd_(event)
Command handler for the "put" command. Displays an inventory of all the props that the player is currently carrying.
Parameters:
{Object} event
The event that triggered the call.

<private> {void} doLookCmd_(event)
Display a list of the items which are present (but not carried) in the current location.
Parameters:
event

<private> {void} doPutCmd_(event)
Command handler for the "put" command. Puts down the specified item, if possible, and displays confirmation.
Parameters:
{Object} event
The event that triggered the call.

<static> {void} com.jiffeegames.Props.es()
Define the Spanish input and output.

init(locate, language)
Parameters:
locate
language

{bool} present(prop)
Test a prop to see if it is present.
Parameters:
{String} prop
The name of the prop being tested.
Returns:
true if the prop is present, else returns false.

{bool} reachable(prop)
Test a prop to see if it is reachable.
Parameters:
{String} prop
The name of the prop being tested.
Returns:
true if the prop is reachable, else returns false.

<private> {void} showHereDesc_(prop)
Decide how to describe a prop in the current location.
Parameters:
prop
Returns:
The string which should be displayed.

<private> {String} showInventory_(prop)
Decide how to describe the player carrying a prop.
Parameters:
prop
Returns:
The string which should be displayed.

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