|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.dimx.LanguageParser
org.dimx.AdvancedLanguageParser
public class AdvancedLanguageParser
| 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 |
|---|
public static final java.lang.String NOUN_LC
public static final java.lang.String PRONOUN_LC
public static final java.lang.String PLURAL_LC
public static final java.lang.String ADJS_LC
public static final java.lang.String PREADJ_LC
public static final java.lang.String TYPE_LC
public static final java.lang.String HS_MARK
public static final java.lang.String HE_MARK
public static final java.lang.String HS_KEY
public static final java.lang.String HE_KEY
public java.lang.String HS_STRING
public java.lang.String HE_STRING
public static final java.lang.String ALPMSGSFILEID
Example:
WORLD
public static final java.lang.String ALPMSGSVARID
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")
public Dict verbs
public Dict say2
public Dict use2
public Dict cmdAliases
public Dict preAdjectives
public Dict preAdjNouns
public Dict adjectives
public Dict nouns
public Dict plurals
public Dict pluralNouns
public Dict nounPlurals
public Dict pronouns
public Dict pronounNouns
public Dict withs
public Dict ands
| Constructor Detail |
|---|
public AdvancedLanguageParser()
| Method Detail |
|---|
protected java.lang.String getTxt(java.lang.String key)
protected java.util.Vector _procLockWithIds(multiplayer server,
World world,
java.util.Vector utils,
Player player,
java.lang.String objtext,
java.lang.String predtext)
server - world - utils - player - objtext - the item doing the locking (the key)predtext - the item being locked (the table)
protected java.util.Vector cmdLOCK(multiplayer server,
World world,
java.util.Vector utils,
Player player,
java.lang.String objtext,
java.lang.String predtext)
cmdLOCK in class LanguageParserserver - world - utils - player - objtext - -- text left of any command predicate (in, on, with, to)predtext - -- text right of any command predicate
protected java.util.Vector cmdUNLOCK(multiplayer server,
World world,
java.util.Vector utils,
Player player,
java.lang.String objtext,
java.lang.String predtext)
server - world - utils - player - objtext - -- text left of any command predicate (in, on, with, to)predtext - -- text right of any command predicate
protected java.util.Vector cmdSAY2(multiplayer server,
World world,
java.util.Vector utils,
Player player,
java.lang.String objtext)
protected java.lang.String[] getMatchingIds(World world,
java.lang.String input_lc,
Dict items,
boolean namematched,
boolean adjmatched)
world - input_lc - items - namematched - if we match name then ALL matches must match on name, tooadjmatched - if we match an adj then ALL matches must match on adj, too
protected java.lang.String[] getMatchingIds(World world,
java.lang.String input_lc,
Dict items)
getMatchingIds in class LanguageParserworld - input_lc - items -
public boolean processPreWorldInit(multiplayer server,
WorldLoader loader,
World world,
java.lang.String systemDir)
processPreWorldInit in interface IWorldInitProcessorserver - loader - world - systemDir -
public boolean processPostWorldInit(multiplayer server,
WorldLoader loader,
World world,
java.lang.String systemDir)
processPostWorldInit in interface IWorldInitProcessorserver - loader - world - systemDir -
protected java.lang.String HL(java.lang.String msgkey)
msgkey -
protected java.util.Vector cmdHELP(multiplayer server,
World world,
java.util.Vector utils,
Player player)
cmdHELP in class LanguageParser
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||