com.planet_ink.coffee_mud.Items.Software
Class StdProgram

java.lang.Object
  extended by com.planet_ink.coffee_mud.Items.Basic.StdItem
      extended by com.planet_ink.coffee_mud.Items.Software.StdProgram
All Implemented Interfaces:
Affectable, Behavable, CMObject, Contingent, DBIdentifiable, Environmental, Modifiable, MsgListener, Physical, PhysicalAgent, Readable, Rider, StatsAffecting, Tickable, Item, Software, Technical, Wearable, java.lang.Cloneable, java.lang.Comparable<CMObject>
Direct Known Subclasses:
GenSoftware

public class StdProgram
extends StdItem
implements Software


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.planet_ink.coffee_mud.Items.interfaces.Technical
Technical.TechCommand, Technical.TechType
 
Nested classes/interfaces inherited from interface com.planet_ink.coffee_mud.Items.interfaces.Wearable
Wearable.CODES
 
Field Summary
protected  java.lang.String currentScreen
           
protected  java.lang.StringBuilder nextMsg
           
 
Fields inherited from class com.planet_ink.coffee_mud.Items.Basic.StdItem
affectPhyStats, affects, baseGoldValue, basePhyStats, behaviors, cachedImageName, CODES, databaseID, description, destroyed, displayText, dispossessionTime, material, me, miscText, myContainer, myUses, myWornCode, name, owner, phyStats, properWornBitmap, rawImageName, riding, scripts, secretIdentity, tickCtr, tickStatus, wornLogicalAnd, xtraValues
 
Fields inherited from interface com.planet_ink.coffee_mud.Items.interfaces.Wearable
DEFAULT_WORN_CODES, DEFAULT_WORN_DEPENDENCYGRID, DEFAULT_WORN_DESCS, DEFAULT_WORN_ORDER, DEFAULT_WORN_USUAL_NAMES, DEFAULT_WORN_WEIGHT_POINTS, DEFAULT_WORN_WEIGHTS, FILTER_ANY, FILTER_MOBINVONLY, FILTER_ROOMONLY, FILTER_UNWORNONLY, FILTER_WORNONLY, HIGHEST_WORN_CODE, IN_INVENTORY, WORN_ABOUT_BODY, WORN_ARMS, WORN_BACK, WORN_EARS, WORN_EYES, WORN_FEET, WORN_FLOATING_NEARBY, WORN_HANDS, WORN_HEAD, WORN_HELD, WORN_LEFT_FINGER, WORN_LEFT_WRIST, WORN_LEGS, WORN_MOUTH, WORN_NECK, WORN_RIGHT_FINGER, WORN_RIGHT_WRIST, WORN_TORSO, WORN_WAIST, WORN_WIELD
 
Constructor Summary
StdProgram()
           
 
Method Summary
 void addScreenMessage(java.lang.String msg)
          Adds a new message to the screen from this program, which will be received by those monitoring the computer
 boolean checkActivate(MOB mob, java.lang.String message)
           
 boolean checkDeactivate(MOB mob, java.lang.String message)
           
 boolean checkPowerCurrent(int value)
           
 boolean checkTyping(MOB mob, java.lang.String message)
           
 java.lang.String display(double[] dir)
           
 java.lang.String display(long d)
           
 java.lang.String display(long[] coords)
           
 java.lang.String displayPerSec(long speed)
           
 void executeMsg(Environmental host, CMMsg msg)
          The general message event handler for the object.
protected  void forceNewMenuRead()
           
protected  void forceNewMessageScan()
           
protected  void forceUpMenu()
           
 java.lang.String getActivationMenu()
          Returns the menu name of this software, so that it can be identified on its parent screen.
 java.lang.String getCurrentScreenDisplay()
          Returns the full screen appearance of this program when it is activated and on the screen.
 java.lang.String getInternalName()
          Returns the internal name of this software.
 java.lang.String getParentMenu()
          The parent menu that this software gets access from.
 java.lang.String getScreenMessage()
          Returns any new messages from this program when it is activated and on the screen.
 Technical.TechType getTechType()
          Returns the tech type enum for this technical object, which describes more about its functionality, and is in fact a kind of class proxy.
 java.lang.String ID()
          The CoffeeMud Java Class ID shared by all instances of this object.
 boolean isActivationString(java.lang.String word)
          Returns whether the given computer-entry command should be responded to by THIS software object on an activation command.
 boolean isCommandString(java.lang.String word, boolean isActive)
          Returns whether the given computer-entry command should be responded to by THIS software object on a WRITE/ENTER command.
 boolean isDeActivationString(java.lang.String word)
          Returns whether the given computer-entry command should be responded to by THIS software object on a deactivation command.
 boolean okMessage(Environmental host, CMMsg msg)
          The general message event previewer for the object.
 void onActivate(MOB mob, java.lang.String message)
           
 void onDeactivate(MOB mob, java.lang.String message)
           
 void onPowerCurrent(int value)
           
 void onTyping(MOB mob, java.lang.String message)
           
 void setCircuitKey(java.lang.String key)
          Software runs on computers, and computers run on power systems.
 void setCurrentScreenDisplay(java.lang.String msg)
           
 void setTechLevel(int lvl)
          One of the most important methods in the tech game, this denotes the level of technology of the specific instance of this item.
 int techLevel()
          One of the most important methods in the tech game, this denotes the level of technology of the specific instance of this item.
 
Methods inherited from class com.planet_ink.coffee_mud.Items.Basic.StdItem
abilityImbuesMagic, addBehavior, addEffect, addNonUninvokableEffect, addScript, affectCharState, affectCharStats, affectPhyStats, alreadyWornMsg, amBeingWornProperly, amDestroyed, amWearingAt, baseGoldValue, basePhyStats, behaviors, canSaveDatabaseID, canWear, canWearComplete, cloneFix, compareProperLocations, compareTo, container, copyOf, databaseID, delAllBehaviors, delAllEffects, delAllScripts, delBehavior, delEffect, delScript, description, description, destroy, displayText, displayText, eachBehavior, eachEffect, eachScript, effects, expirationDate, fetchBehavior, fetchBehavior, fetchEffect, fetchEffect, fetchScript, fitsOn, getCodeNum, getSaveStatIndex, getStat, getStatCodes, getTickStatus, I, image, initializeClass, isGeneric, isReadable, isSavable, isStat, L, material, maxRange, minRange, miscTextFormat, name, Name, name, newInstance, numBehaviors, numberOfItems, numEffects, numScripts, owner, phyStats, rawImage, rawLogicalAnd, rawProperLocationBitmap, rawSecretIdentity, rawWornCode, readableText, recoverPhyStats, recursiveWeight, removeFromOwnerContainer, riding, sameAs, scripts, secretIdentity, setBasePhyStats, setBaseValue, setContainer, setDatabaseID, setDescription, setDisplayText, setExpirationDate, setImage, setMaterial, setMiscText, setName, setOwner, setRawLogicalAnd, setRawProperLocationBitmap, setRawWornCode, setReadable, setReadableText, setRiding, setSavable, setSecretIdentity, setStat, setUsesRemaining, stopTicking, subjectToWearAndTear, tackOns, text, tick, ultimateContainer, unWear, usesRemaining, value, wearAt, wearEvenIfImpossible, wearIfPossible, wearIfPossible, whereCantWear
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.planet_ink.coffee_mud.Items.interfaces.Item
baseGoldValue, container, material, numberOfItems, owner, rawSecretIdentity, recursiveWeight, removeFromOwnerContainer, secretIdentity, setBaseValue, setContainer, setMaterial, setOwner, setSecretIdentity, setUsesRemaining, stopTicking, subjectToWearAndTear, ultimateContainer, usesRemaining, value
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Rider
riding, setRiding
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.CMObject
copyOf, initializeClass, newInstance
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.DBIdentifiable
canSaveDatabaseID, databaseID, setDatabaseID
 
Methods inherited from interface com.planet_ink.coffee_mud.Items.interfaces.Wearable
amBeingWornProperly, amWearingAt, canWear, compareProperLocations, fitsOn, rawLogicalAnd, rawProperLocationBitmap, rawWornCode, setRawLogicalAnd, setRawProperLocationBitmap, setRawWornCode, unWear, wearAt, wearEvenIfImpossible, wearIfPossible, wearIfPossible, whereCantWear
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Readable
isReadable, readableText, setReadable, setReadableText
 

Field Detail

nextMsg

protected java.lang.StringBuilder nextMsg

currentScreen

protected java.lang.String currentScreen
Constructor Detail

StdProgram

public StdProgram()
Method Detail

ID

public java.lang.String ID()
Description copied from interface: CMObject
The CoffeeMud Java Class ID shared by all instances of this object. Unlike the Java Class name, this method does not include package information. However, it must return a String value unique to its class category in the ClassLoader. Class categories include Libraries, Common, Areas, Abilities, Behaviors, CharClasses, Commands, Exits Locales, MOBS, Races, WebMacros, Basic Items, Armor, Weapons, ClanItems, Tech. The name is typically identical to the class name.

Specified by:
ID in interface CMObject
Overrides:
ID in class StdItem
Returns:
the name of this class

setCircuitKey

public void setCircuitKey(java.lang.String key)
Description copied from interface: Software
Software runs on computers, and computers run on power systems. This method tells the software what the power system "circuit" key is that the computer host is running on, allowing the software to find other equipment on the same circuit and control it.

Specified by:
setCircuitKey in interface Software
Parameters:
key - the circuit key

techLevel

public int techLevel()
Description copied from interface: Technical
One of the most important methods in the tech game, this denotes the level of technology of the specific instance of this item. Technology progresses ever onward, and the users equipment can become outdated, and be outperformed by items with higher tech level. For that reason, they must constantly be looking to keeping their gear updates.

Specified by:
techLevel in interface Technical
Returns:
the absolute tech level of this item
See Also:
TechLibrary.getGlobalTechLevel(), Technical.setTechLevel(int)

setTechLevel

public void setTechLevel(int lvl)
Description copied from interface: Technical
One of the most important methods in the tech game, this denotes the level of technology of the specific instance of this item. Technology progresses ever onward, and the users equipment can become outdated, and be outperformed by items with higher tech level. For that reason, they must constantly be looking to keeping their gear updates.

Specified by:
setTechLevel in interface Technical
Parameters:
lvl - the absolute tech level of this item
See Also:
TechLibrary.getGlobalTechLevel(), Technical.techLevel()

getParentMenu

public java.lang.String getParentMenu()
Description copied from interface: Software
The parent menu that this software gets access from. When Software is available from root, "" is returned.

Specified by:
getParentMenu in interface Software
Returns:
parent menu that this software gets access from

getInternalName

public java.lang.String getInternalName()
Description copied from interface: Software
Returns the internal name of this software.

Specified by:
getInternalName in interface Software
Returns:
the internal name of this software.

isActivationString

public boolean isActivationString(java.lang.String word)
Description copied from interface: Software
Returns whether the given computer-entry command should be responded to by THIS software object on an activation command.

Specified by:
isActivationString in interface Software
Parameters:
word - the computer-entry command entered
Returns:
true if this software should respond.

isDeActivationString

public boolean isDeActivationString(java.lang.String word)
Description copied from interface: Software
Returns whether the given computer-entry command should be responded to by THIS software object on a deactivation command.

Specified by:
isDeActivationString in interface Software
Parameters:
word - the computer-entry command entered
Returns:
true if this software should respond.

isCommandString

public boolean isCommandString(java.lang.String word,
                               boolean isActive)
Description copied from interface: Software
Returns whether the given computer-entry command should be responded to by THIS software object on a WRITE/ENTER command.

Specified by:
isCommandString in interface Software
Parameters:
word - the computer-entry command
isActive - true if the software is already activated
Returns:
true if this software can respond

getTechType

public Technical.TechType getTechType()
Description copied from interface: Technical
Returns the tech type enum for this technical object, which describes more about its functionality, and is in fact a kind of class proxy. I hope this doesn't bog things down too much.

Specified by:
getTechType in interface Technical
Returns:
the tech type eum
See Also:
Technical.TechType

getActivationMenu

public java.lang.String getActivationMenu()
Description copied from interface: Software
Returns the menu name of this software, so that it can be identified on its parent screen.

Specified by:
getActivationMenu in interface Software
Returns:
the menu name of this software

getCurrentScreenDisplay

public java.lang.String getCurrentScreenDisplay()
Description copied from interface: Software
Returns the full screen appearance of this program when it is activated and on the screen. Only those intentially looking at the screen again, or forced by the program, will see this larger message.

Specified by:
getCurrentScreenDisplay in interface Software
Returns:
the entire screen message
See Also:
Software.addScreenMessage(String), Software.getScreenMessage()

setCurrentScreenDisplay

public void setCurrentScreenDisplay(java.lang.String msg)

getScreenMessage

public java.lang.String getScreenMessage()
Description copied from interface: Software
Returns any new messages from this program when it is activated and on the screen. Seen by those monitoring the computer.

Specified by:
getScreenMessage in interface Software
Returns:
the new screen messages
See Also:
Software.addScreenMessage(String), Software.getCurrentScreenDisplay()

addScreenMessage

public void addScreenMessage(java.lang.String msg)
Description copied from interface: Software
Adds a new message to the screen from this program, which will be received by those monitoring the computer

Specified by:
addScreenMessage in interface Software
Parameters:
msg - the new message for the screen
See Also:
Software.getScreenMessage(), Software.getCurrentScreenDisplay()

forceUpMenu

protected void forceUpMenu()

forceNewMessageScan

protected void forceNewMessageScan()

forceNewMenuRead

protected void forceNewMenuRead()

checkActivate

public boolean checkActivate(MOB mob,
                             java.lang.String message)

checkDeactivate

public boolean checkDeactivate(MOB mob,
                               java.lang.String message)

checkTyping

public boolean checkTyping(MOB mob,
                           java.lang.String message)

checkPowerCurrent

public boolean checkPowerCurrent(int value)

okMessage

public boolean okMessage(Environmental host,
                         CMMsg msg)
Description copied from interface: MsgListener
The general message event previewer for the object. Messages passed herein are in a pending state, and may be safely modified or rejected without fear that they might be in the middle of being executed. Messages passed herein may not necessarily be FOR or FROM this object, but will almost always represent events which want to happen in the same rom. This method should always always return true UNLESS this message needs to be canceled, in which case it is necessary to tell the mob initiating the event (CMMsg.source()) why it is being cancelled. Every game event goes through these methods.

Specified by:
okMessage in interface MsgListener
Overrides:
okMessage in class StdItem
Parameters:
host - either the initiator of the event, or the host of this object
msg - the CMMsg that wants to be executed
Returns:
whether this message is allowed to execute
See Also:
CMMsg, CMMsg.source()

onActivate

public void onActivate(MOB mob,
                       java.lang.String message)

onDeactivate

public void onDeactivate(MOB mob,
                         java.lang.String message)

onTyping

public void onTyping(MOB mob,
                     java.lang.String message)

onPowerCurrent

public void onPowerCurrent(int value)

executeMsg

public void executeMsg(Environmental host,
                       CMMsg msg)
Description copied from interface: MsgListener
The general message event handler for the object. Messages passed herein may not necessarily be FOR this object, or from it, but will almost always represent events happening in the same room. The messages have already been through an approval process, so this method is called only to affect the final execution of the meaning of the message. Every game event goes through these methods.

Specified by:
executeMsg in interface MsgListener
Overrides:
executeMsg in class StdItem
Parameters:
host - either the initiator of the event, or the host of this object
msg - the CMMsg that needs to be executed
See Also:
CMMsg

display

public java.lang.String display(long d)

display

public java.lang.String display(long[] coords)

display

public java.lang.String display(double[] dir)

displayPerSec

public java.lang.String displayPerSec(long speed)