org.dimx
Class AdvancedLanguageParser

java.lang.Object
  extended by org.dimx.LanguageParser
      extended by org.dimx.AdvancedLanguageParser
All Implemented Interfaces:
ISayProcessor, IWorldInitProcessor

public class AdvancedLanguageParser
extends LanguageParser
implements IWorldInitProcessor


Field Summary
 Dict adjectives
           
static java.lang.String ADJS_LC
           
static java.lang.String ALPMSGSFILEID
          "alpmsgsFile" Attribute sought in WORLD ATTRLIST identifying the file to use for custom messages:
static java.lang.String ALPMSGSVARID
          "alpmsgs" Attribute sought in WORLD ATTRLIST identifying the World varname to use in Dimx Scripts.
 Dict ands
           
 Dict cmdAliases
           
static java.lang.String HE_KEY
          "hilite_end" -- custom message key for HIILITE_END Html to be inserted at $HE markers in custom messages.
static java.lang.String HE_MARK
          "$HE" -- Used in custom messages to designate HILITE_END Example in custom messages file:
cust_message=The text between the tags is $HShighlighted$HE!
 java.lang.String HE_STRING
          "</i>" -- Default hilite_end String.
static java.lang.String HS_KEY
          "hilite_start" -- custom message key for HIILITE_START Html to be inserted at $HS markers in custom messages.
static java.lang.String HS_MARK
          "$HS" -- Used in custom messages to designate HILITE_START.
 java.lang.String HS_STRING
          "<i CLASS='iconlabel'>" -- Default hilite_start String.
static java.lang.String NOUN_LC
           
 Dict nounPlurals
           
 Dict nouns
           
static java.lang.String PLURAL_LC
           
 Dict pluralNouns
           
 Dict plurals
           
static java.lang.String PREADJ_LC
           
 Dict preAdjectives
           
 Dict preAdjNouns
           
static java.lang.String PRONOUN_LC
           
 Dict pronounNouns
           
 Dict pronouns
           
 Dict say2
           
static java.lang.String TYPE_LC
           
 Dict use2
           
 Dict verbs
           
 Dict withs
           
 
Fields inherited from class org.dimx.LanguageParser
close_bracket, CLOSE_LC, colon, comma, D_LC, D_UC, DOWN_LC, DROP_LC, E_LC, E_UC, EAST_LC, ENTER_LC, exclamation, EXIT_LC, GIVE_LC, GO_LC, HIDE_LC, IN_LC, L_LC, LEFT_LC, LOCK_LC, logDebug, LOOK_LC, N_LC, N_UC, NORTH_LC, ON_LC, open_bracket, OPEN_LC, period, PICK_LC, PREDICATES_LC, PUT_LC, question, RIGHT_LC, ROTATE_LC, S_LC, S_UC, SAVE_LC, SAVEEXIT_LC, SAY_LC, SEARCH_LC, semicolon, SLASH_DISCONNECT, SLASH_HELP, SLASH_SAVE, SLASH_SAVEEXIT, SOUTH_LC, space, TL_LC, TO_LC, TR_LC, TURN_LC, U_LC, U_UC, UNLOCK_LC, UP_LC, USE_LC, W_LC, W_UC, WEST_LC, WITH_LC
 
Constructor Summary
AdvancedLanguageParser()
           
 
Method Summary
protected  java.util.Vector _procLockWithIds(multiplayer server, World world, java.util.Vector utils, Player player, java.lang.String objtext, java.lang.String predtext)
          Called from cmdLOCK and cmdUNLOCK for identical processing.
protected  java.util.Vector cmdHELP(multiplayer server, World world, java.util.Vector utils, Player player)
           
protected  java.util.Vector cmdLOCK(multiplayer server, World world, java.util.Vector utils, Player player, java.lang.String objtext, java.lang.String predtext)
          Lock With command processing.
protected  java.util.Vector cmdSAY2(multiplayer server, World world, java.util.Vector utils, Player player, java.lang.String objtext)
           
protected  java.util.Vector cmdUNLOCK(multiplayer server, World world, java.util.Vector utils, Player player, java.lang.String objtext, java.lang.String predtext)
          UnLock With command processing.
protected  java.lang.String[] getMatchingIds(World world, java.lang.String input_lc, Dict items)
          Attempt to match the input_lc with the Name of an AdvObject in the items Dict.
protected  java.lang.String[] getMatchingIds(World world, java.lang.String input_lc, Dict items, boolean namematched, boolean adjmatched)
          Attempt to match the input_lc with the Name of an AdvObject in the items Dict.
protected  java.lang.String getTxt(java.lang.String key)
           
protected  java.lang.String HL(java.lang.String msgkey)
          Extract and hilite the message defined by msgkey
 boolean processPostWorldInit(multiplayer server, WorldLoader loader, World world, java.lang.String systemDir)
          Perform custom initialization and allow normal world.init to finalize.
 boolean processPreWorldInit(multiplayer server, WorldLoader loader, World world, java.lang.String systemDir)
          This API is subject to change until it is fully developed.
 
Methods inherited from class org.dimx.LanguageParser
badCLOSE, badDROP, badENTER, badGIVE, badGO, badHIDE, badOPEN, badPUT, badUSE, clearCmdVector, cmdCLOSE, cmdDISCONNECT, cmdDROP, cmdENTER, cmdEXIT, cmdGIVE, cmdGO, cmdHIDE, cmdLOOK, cmdOPEN, cmdPICK, cmdPUT, cmdREVERSE, cmdSAVE, cmdSAY, cmdSAYTO, cmdSEARCH, cmdTURN, cmdUSE, getMatchingContainerIds, getMatchingInventoryIds, processSay
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NOUN_LC

public static final java.lang.String NOUN_LC
See Also:
Constant Field Values

PRONOUN_LC

public static final java.lang.String PRONOUN_LC
See Also:
Constant Field Values

PLURAL_LC

public static final java.lang.String PLURAL_LC
See Also:
Constant Field Values

ADJS_LC

public static final java.lang.String ADJS_LC
See Also:
Constant Field Values

PREADJ_LC

public static final java.lang.String PREADJ_LC
See Also:
Constant Field Values

TYPE_LC

public static final java.lang.String TYPE_LC
See Also:
Constant Field Values

HS_MARK

public static final java.lang.String HS_MARK
"$HS" -- Used in custom messages to designate HILITE_START. Example in custom messages file:
cust_message=The text between the tags is $HShighlighted$HE!

See Also:
Constant Field Values

HE_MARK

public static final java.lang.String HE_MARK
"$HE" -- Used in custom messages to designate HILITE_END Example in custom messages file:
cust_message=The text between the tags is $HShighlighted$HE!

See Also:
Constant Field Values

HS_KEY

public static final java.lang.String HS_KEY
"hilite_start" -- custom message key for HIILITE_START Html to be inserted at $HS markers in custom messages. Example in custom messages file:
hilite_start=<i CLASS='iconlabel'>
hilite_end =</i>

See Also:
Constant Field Values

HE_KEY

public static final java.lang.String HE_KEY
"hilite_end" -- custom message key for HIILITE_END Html to be inserted at $HE markers in custom messages. Example in custom messages file:
hilite_start=<i CLASS='iconlabel'>
hilite_end =</i>

See Also:
Constant Field Values

HS_STRING

public java.lang.String HS_STRING
"<i CLASS='iconlabel'>" -- Default hilite_start String.


HE_STRING

public java.lang.String HE_STRING
"</i>" -- Default hilite_end String.


ALPMSGSFILEID

public static final java.lang.String ALPMSGSFILEID
"alpmsgsFile" Attribute sought in WORLD ATTRLIST identifying the file to use for custom messages:

Example:
WORLD

See Also:
Constant Field Values

ALPMSGSVARID

public static final java.lang.String ALPMSGSVARID
"alpmsgs" Attribute sought in WORLD ATTRLIST identifying the World varname to use in Dimx Scripts. If no value is specified then the variable used in scripts will be 'alpmsgs'.

Example:
WORLD

Then reference custom messages in scripts as:

csimsg("key_name")

Implement a Function in your script to return properly hilited text by processing the $HS and $HE markers in the message file.

Example Script Function:

Function HL(key_name) Dim s = Replace(csimsg(key_name),"$HS",csimsg("hilite_start")) Return Replace(s,"$HE",csimsg("hilite_end")) End_Function Then properly hilite custom messages in scripts:

text = HL("key_name")

See Also:
Constant Field Values

verbs

public Dict verbs

say2

public Dict say2

use2

public Dict use2

cmdAliases

public Dict cmdAliases

preAdjectives

public Dict preAdjectives

preAdjNouns

public Dict preAdjNouns

adjectives

public Dict adjectives

nouns

public Dict nouns

plurals

public Dict plurals

pluralNouns

public Dict pluralNouns

nounPlurals

public Dict nounPlurals

pronouns

public Dict pronouns

pronounNouns

public Dict pronounNouns

withs

public Dict withs

ands

public Dict ands
Constructor Detail

AdvancedLanguageParser

public AdvancedLanguageParser()
Method Detail

getTxt

protected java.lang.String getTxt(java.lang.String key)

_procLockWithIds

protected java.util.Vector _procLockWithIds(multiplayer server,
                                            World world,
                                            java.util.Vector utils,
                                            Player player,
                                            java.lang.String objtext,
                                            java.lang.String predtext)
Called from cmdLOCK and cmdUNLOCK for identical processing.

Parameters:
server -
world -
utils -
player -
objtext - the item doing the locking (the key)
predtext - the item being locked (the table)
Returns:
utils

cmdLOCK

protected java.util.Vector cmdLOCK(multiplayer server,
                                   World world,
                                   java.util.Vector utils,
                                   Player player,
                                   java.lang.String objtext,
                                   java.lang.String predtext)
Lock With command processing. Attempts to match objtext with local items and inventory. Attempts to match predtext with local items, inventory, and room links. Multiple matches on either will always default to the first one found.

Overrides:
cmdLOCK in class LanguageParser
Parameters:
server -
world -
utils -
player -
objtext - -- text left of any command predicate (in, on, with, to)
predtext - -- text right of any command predicate
Returns:

cmdUNLOCK

protected java.util.Vector cmdUNLOCK(multiplayer server,
                                     World world,
                                     java.util.Vector utils,
                                     Player player,
                                     java.lang.String objtext,
                                     java.lang.String predtext)
UnLock With command processing. Attempts to match objtext with local items and inventory. Attempts to match predtext with local items, inventory, and room links. Multiple matches on either will always default to the first one found.

Parameters:
server -
world -
utils -
player -
objtext - -- text left of any command predicate (in, on, with, to)
predtext - -- text right of any command predicate
Returns:

cmdSAY2

protected java.util.Vector cmdSAY2(multiplayer server,
                                   World world,
                                   java.util.Vector utils,
                                   Player player,
                                   java.lang.String objtext)

getMatchingIds

protected java.lang.String[] getMatchingIds(World world,
                                            java.lang.String input_lc,
                                            Dict items,
                                            boolean namematched,
                                            boolean adjmatched)
Attempt to match the input_lc with the Name of an AdvObject in the items Dict. Will attempt to id items in open container items, too. if we match an adj then ALL matches must match on adj, too if we match name then ALL matches must match on name, too

Parameters:
world -
input_lc -
items -
namematched - if we match name then ALL matches must match on name, too
adjmatched - if we match an adj then ALL matches must match on adj, too
Returns:
0 or more item Ids who's full NAME can be found in text_lc

getMatchingIds

protected java.lang.String[] getMatchingIds(World world,
                                            java.lang.String input_lc,
                                            Dict items)
Attempt to match the input_lc with the Name of an AdvObject in the items Dict. Will attempt to id items in open container items, too.

Overrides:
getMatchingIds in class LanguageParser
Parameters:
world -
input_lc -
items -
Returns:
0 or more item Ids who's full NAME can be found in text_lc

processPreWorldInit

public boolean processPreWorldInit(multiplayer server,
                                   WorldLoader loader,
                                   World world,
                                   java.lang.String systemDir)
This API is subject to change until it is fully developed.

Specified by:
processPreWorldInit in interface IWorldInitProcessor
Parameters:
server -
loader -
world -
systemDir -
Returns:
boolean true to allow normal world.init processing to continue; false to bypass normal world.init processing.

processPostWorldInit

public boolean processPostWorldInit(multiplayer server,
                                    WorldLoader loader,
                                    World world,
                                    java.lang.String systemDir)
Perform custom initialization and allow normal world.init to finalize. This API is subject to change until it is fully developed.

Specified by:
processPostWorldInit in interface IWorldInitProcessor
Parameters:
server -
loader -
world -
systemDir -
Returns:
boolean true to allow remaining init processing to continue; false to bypass remaining init processing.

HL

protected java.lang.String HL(java.lang.String msgkey)
Extract and hilite the message defined by msgkey

Parameters:
msgkey -
Returns:
text of message hilited as appropriate

cmdHELP

protected java.util.Vector cmdHELP(multiplayer server,
                                   World world,
                                   java.util.Vector utils,
                                   Player player)
Overrides:
cmdHELP in class LanguageParser