com.planet_ink.coffee_mud.Items.BasicTech
Class GenSpaceShip

java.lang.Object
  extended by com.planet_ink.coffee_mud.Items.Basic.StdItem
      extended by com.planet_ink.coffee_mud.Items.Basic.StdContainer
          extended by com.planet_ink.coffee_mud.Items.Basic.StdPortal
              extended by com.planet_ink.coffee_mud.Items.Basic.StdBoardable
                  extended by com.planet_ink.coffee_mud.Items.BasicTech.GenSpaceShip
All Implemented Interfaces:
Affectable, Behavable, BoundedObject, CloseableLockable, CMObject, Contingent, DBIdentifiable, Environmental, Modifiable, MsgListener, Physical, PhysicalAgent, PrivateProperty, Readable, Rideable, Rider, SpaceObject, StatsAffecting, Tickable, Exit, BoardableShip, Container, Electronics, Item, SpaceShip, Technical, Wearable, java.lang.Cloneable, java.lang.Comparable<CMObject>

public class GenSpaceShip
extends StdBoardable
implements Electronics, SpaceShip


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
 
Nested classes/interfaces inherited from interface com.planet_ink.coffee_mud.Items.interfaces.SpaceShip
SpaceShip.ShipFlag
 
Nested classes/interfaces inherited from interface com.planet_ink.coffee_mud.core.interfaces.SpaceObject
SpaceObject.Distance
 
Nested classes/interfaces inherited from interface com.planet_ink.coffee_mud.core.interfaces.BoundedObject
BoundedObject.BoundedCube
 
Field Summary
protected  Manufacturer cachedManufact
           
 long[] coordinates
           
 double[] direction
           
protected  double[] facing
           
protected  java.lang.String manufacturer
           
 double roll
           
protected  java.util.Set<SpaceShip.ShipFlag> shipFlags
           
protected  SpaceObject spaceTarget
           
 double speed
           
protected  double speedTick
           
 
Fields inherited from class com.planet_ink.coffee_mud.Items.Basic.StdBoardable
area, homePortID, internalPrice, ownerName, price, readableText
 
Fields inherited from class com.planet_ink.coffee_mud.Items.Basic.StdPortal
closedText, dismountString, doorName, mountString, putString, rideString, stateString, stateSubjectStr
 
Fields inherited from class com.planet_ink.coffee_mud.Items.Basic.StdContainer
capacity, containType, defaultsClosed, defaultsLocked, hasALid, hasALock, isLocked, isOpen, openDelayTicks
 
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
 
Fields inherited from interface com.planet_ink.coffee_mud.core.interfaces.SpaceObject
ACCELERATION_DAMAGED, ACCELERATION_G, ACCELERATION_INSTANTDEATH, ACCELERATION_PASSOUT, ACCELERATION_TYPICALROCKET, ACCELERATION_TYPICALSPACEROCKET, ACCELERATION_UNCONSCIOUSNESS, ASTEROID_MASS, ATMOSPHERIC_DRAG_BRICK, ATMOSPHERIC_DRAG_STREAMLINE, DISTANCES, MOONLET_MASS, MULTIPLIER_GRAVITY_EFFECT_RADIUS, MULTIPLIER_ORBITING_RADIUS_MAX, MULTIPLIER_ORBITING_RADIUS_MIN, MULTIPLIER_PLANET_MASS, MULTIPLIER_STAR_MASS, VELOCITY_ESCAPE, VELOCITY_LIGHT, VELOCITY_ORBITING, VELOCITY_SOUND, VELOCITY_SUBLIGHT, VELOCITY_TRANSWARP1, VELOCITY_TRANSWARP10, VELOCITY_TRANSWARP2, VELOCITY_TRANSWARP3, VELOCITY_TRANSWARP4, VELOCITY_TRANSWARP5, VELOCITY_TRANSWARP6, VELOCITY_TRANSWARP7, VELOCITY_TRANSWARP8, VELOCITY_TRANSWARP9, VELOCITY_WARP1, VELOCITY_WARP10, VELOCITY_WARP2, VELOCITY_WARP3, VELOCITY_WARP4, VELOCITY_WARP5, VELOCITY_WARP6, VELOCITY_WARP7, VELOCITY_WARP8, VELOCITY_WARP9
 
Fields inherited from interface com.planet_ink.coffee_mud.core.interfaces.Rideable
RIDEABLE_AIR, RIDEABLE_DESCS, RIDEABLE_ENTERIN, RIDEABLE_LADDER, RIDEABLE_LAND, RIDEABLE_SIT, RIDEABLE_SLEEP, RIDEABLE_TABLE, RIDEABLE_WAGON, RIDEABLE_WATER
 
Fields inherited from interface com.planet_ink.coffee_mud.Items.interfaces.Container
CONTAIN_ANYTHING, CONTAIN_BODIES, CONTAIN_CAGED, CONTAIN_CLOTHES, CONTAIN_COINS, CONTAIN_DAGGERS, CONTAIN_DESCS, CONTAIN_DRINKABLES, CONTAIN_EATABLES, CONTAIN_FOOTWEAR, CONTAIN_KEYS, CONTAIN_LIQUID, CONTAIN_ONEHANDWEAPONS, CONTAIN_OTHERWEAPONS, CONTAIN_RAWMATERIALS, CONTAIN_READABLES, CONTAIN_SCROLLS, CONTAIN_SMOKEABLES, CONTAIN_SSCOMPONENTS, CONTAIN_SWORDS
 
Constructor Summary
GenSpaceShip()
           
 
Method Summary
 void activate(boolean truefalse)
          Sets whether this electrical item is "turned on".
 boolean activated()
          Gets whether this electrical item is "turned on".
 long[] coordinates()
          The current absolute coordinates of the object
protected  Room createFirstRoom()
           
 double[] direction()
          The direction of travel of this object in radians.
 void dockHere(Room R)
          Designates that this ship is landed and docked in the given planetary room.
 void executeMsg(Environmental myHost, CMMsg msg)
          The general message event handler for the object.
 double[] facing()
          The direction of facing of this object in radians.
protected  LocationRoom findNearestDocks(Room R)
           
protected  java.lang.String getAreaClassType()
           
 BoundedObject.BoundedCube getBounds()
           
protected  int getCodeNum(java.lang.String code)
           
 Manufacturer getFinalManufacturer()
          Returns the Manufacturer object of the manufacturer that made this electrical item.
 java.lang.String getManufacturerName()
          Gets the Manufacturer ID/Name that made this electrical item.
 long getMass()
          Returns the mass of this object, derived from its radius and type, or perhaps from other things.
 double getOMLCoeff()
          The Outer Mold Line coefficient -- how streamlined are you?
 Area getShipArea()
          Space ships are unique in having an Item stand-in for dirt-side access, as well as an Area object.
 boolean getShipFlag(SpaceShip.ShipFlag flag)
          Gets one of the ship flags
 SpaceObject getShipSpaceObject()
          Space ships are unique in having an Item stand-in for planet-side access, as well as an Area object.
 java.lang.String getStat(java.lang.String code)
          An alternative means of retreiving the values of those fields on this object which are modifiable at run-time by builders.
 java.lang.String[] getStatCodes()
          Returns an array of the string names of those fields which are modifiable on this object at run-time by builders.
 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 isGeneric()
          Whether the fields of this item are set in code, or set by builders.
 SpaceObject knownSource()
          The source object from which this space object is travelling from
 SpaceObject knownTarget()
          If this object is targeting another space object as a destination, this will return it
 boolean okMessage(Environmental myHost, CMMsg msg)
          The general message event previewer for the object.
 long powerCapacity()
          Gets the maximum amount of capacitance supported by this electrical item.
 int powerNeeds()
          Returns the immediate power needs of this electrical item.
 long powerRemaining()
          Gets the amount of power capacitance remaining in this electrical item.
 long radius()
          The current radius of the object
 void recoverPhyStats()
          This method copies the basePhyStats() object into the phyStats() object, then makes repeated calls to all surrounding objects with affectPhyStats(Environmental,PhyStats) method.
 void renameShip(java.lang.String newName)
          Renames the ship to something else
 double roll()
          The full 360 orientation of the top of the object in radians.
 boolean sameAs(Environmental E)
          Whether this object instance is functionally identical to the object passed in.
protected  void sendComputerMessage(MOB mob, CMMsg msg)
           
 void setCoords(long[] coords)
          Sets the current absolute coordinates of the object
 void setDirection(double[] dir)
          Sets the direction of travel of this object in radians.
 void setFacing(double[] dir)
          Sets the direction of facing of this object in radians.
 void setKnownSource(SpaceObject O)
          Sets the source object from which this space object is travelling from
 void setKnownTarget(SpaceObject O)
          If this object is targeting another space object as a destination, this will set it
 void setManufacturerName(java.lang.String name)
          Sets the Manufacturer ID/Name that made this electrical item.
 void setOMLCoeff(double coeff)
          Set the Outer Mold Line coefficient -- how streamlined are you?
 void setPowerCapacity(long capacity)
          Sets the maximum amount of capacitance supported by this electrical item.
 void setPowerRemaining(long remaining)
          Sets the amount of power capacitance remaining in this electrical item.
 void setRadius(long radius)
          Set the current radius of the object
 void setRoll(double dir)
          Sets the full 360 orientation of the top of the object in radians.
 void setShipFlag(SpaceShip.ShipFlag flag, boolean setFlag)
          Sets one of the ship flags
 void setSpeed(double v)
          Sets the speed of the object through space
 void setStat(java.lang.String code, java.lang.String val)
          An alternative means of setting the values of those fields on this object which are modifiable at run-time by builders.
 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.
 double speed()
          The speed of the object through space
protected  void stopThisShip(MOB mob)
           
 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.
 boolean tick(Tickable ticking, int tickID)
          this is the method which is called periodically by the threading engine.
 Room unDock(boolean moveToOutside)
          Designates that this ship is no longer docked, and whether it should also be moved into its na
 
Methods inherited from class com.planet_ink.coffee_mud.Items.Basic.StdBoardable
announceToShip, confirmAreaMessage, copyOf, destroy, destroyThisShip, dismountString, expirationDate, getDestinationRoom, getHomePortID, getIsDocked, getOwnerName, getOwnerObject, getPrice, getShipItem, getTitleID, isSavable, keyName, mountString, newInstance, okAreaMessage, putString, readableText, renameDestinationRooms, securityCheck, sendAreaMessage, setDatabaseID, setDockableItem, setExpirationDate, setHomePortID, setKeyName, setMiscText, setOwnerName, setPrice, setReadableText, setShipArea, stopTicking, subjectToWearAndTear, text, transferOwnership, value
 
Methods inherited from class com.planet_ink.coffee_mud.Items.Basic.StdPortal
addRider, amRiding, closedText, closeWord, defaultsClosed, defaultsLocked, delRider, displayText, doorName, exitUsage, fetchRider, getDismountString, getMountString, getPutString, getRideBuddies, getRideString, getStateString, getStateStringSubject, hasADoor, isMobileRideBasis, isReadable, lastRoomUsedFrom, mobileRideBasis, numRiders, openDelayTicks, openWord, rideBasis, riderCapacity, riders, rideString, setDismountString, setDoorsNLocks, setExitParams, setMountString, setOpenDelayTicks, setPutString, setReadable, setRideBasis, setRiderCapacity, setRideString, setStateString, setStateStringSubject, setTemporaryDoorLink, stateString, stateStringSubject, temporaryDoorLink, viewableText
 
Methods inherited from class com.planet_ink.coffee_mud.Items.Basic.StdContainer
canContain, capacity, containTypes, emptyPlease, getContents, getDeepContents, hasALock, hasContent, isInside, isLocked, isOpen, numberOfItems, recursiveWeight, setCapacity, setContainTypes
 
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, databaseID, delAllBehaviors, delAllEffects, delAllScripts, delBehavior, delEffect, delScript, description, description, displayText, eachBehavior, eachEffect, eachScript, effects, fetchBehavior, fetchBehavior, fetchEffect, fetchEffect, fetchScript, fitsOn, getSaveStatIndex, getTickStatus, I, image, initializeClass, isStat, L, material, maxRange, minRange, miscTextFormat, name, Name, name, numBehaviors, numEffects, numScripts, owner, phyStats, rawImage, rawLogicalAnd, rawProperLocationBitmap, rawSecretIdentity, rawWornCode, removeFromOwnerContainer, riding, scripts, secretIdentity, setBasePhyStats, setBaseValue, setContainer, setDescription, setDisplayText, setImage, setMaterial, setName, setOwner, setRawLogicalAnd, setRawProperLocationBitmap, setRawWornCode, setRiding, setSavable, setSecretIdentity, setUsesRemaining, tackOns, ultimateContainer, unWear, usesRemaining, 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
 
Methods inherited from interface com.planet_ink.coffee_mud.Items.interfaces.BoardableShip
getHomePortID, getIsDocked, getShipItem, setDockableItem, setHomePortID, setShipArea
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.CloseableLockable
hasALock, isLocked, isOpen
 

Field Detail

cachedManufact

protected Manufacturer cachedManufact

manufacturer

protected java.lang.String manufacturer

coordinates

public long[] coordinates

direction

public double[] direction

roll

public double roll

speed

public double speed

spaceTarget

protected SpaceObject spaceTarget

facing

protected double[] facing

shipFlags

protected java.util.Set<SpaceShip.ShipFlag> shipFlags

speedTick

protected volatile double speedTick
Constructor Detail

GenSpaceShip

public GenSpaceShip()
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 StdBoardable
Returns:
the name of this class

isGeneric

public boolean isGeneric()
Description copied from interface: Environmental
Whether the fields of this item are set in code, or set by builders. Generic means that they are set by builders, in which case XML is returned by the text() method containing all of the values for all the fields.

Specified by:
isGeneric in interface Environmental
Overrides:
isGeneric in class StdItem
Returns:
whether this item is modifiable by builders
See Also:
Environmental.text()

recoverPhyStats

public void recoverPhyStats()
Description copied from interface: Affectable
This method copies the basePhyStats() object into the phyStats() object, then makes repeated calls to all surrounding objects with affectPhyStats(Environmental,PhyStats) method. Surrounding objects include the room where the object is located, the Ability objects in the Effects list, the Behaviors in the behaviors list, and race/charclass/area if applicable. Those methods will then make all necessary adjustments to the values in the new phyStats() object. When it returns, phyStats() will have a totally updated object. This method must be called in code whenever the object is placed on the map, or when anything changes in its environment, such as location, effects, or other states.

Specified by:
recoverPhyStats in interface Affectable
Overrides:
recoverPhyStats in class StdPortal
See Also:
Affectable.basePhyStats(), Affectable.phyStats(), Affectable.addEffect(Ability), Behavable.addBehavior(Behavior), PhyStats

getAreaClassType

protected java.lang.String getAreaClassType()
Overrides:
getAreaClassType in class StdBoardable

tick

public boolean tick(Tickable ticking,
                    int tickID)
Description copied from interface: Tickable
this is the method which is called periodically by the threading engine. How often it is called depends on the parameters passed to the threadding engine when it is submitted for thread access. Typically the period is once per TIME_TICK period, but that is determined when the object is submitted to the thread engine.

Specified by:
tick in interface Tickable
Overrides:
tick in class StdBoardable
Parameters:
ticking - a reference to this Tickable object
tickID - the TICKID_ constant describing this periodic call, as defined in Tickable
Returns:
true always, unless this object no longer wishes to ever tick again, in which case false
See Also:
Tickable, ServiceEngine, TickableGroup

createFirstRoom

protected Room createFirstRoom()
Overrides:
createFirstRoom in class StdBoardable

getShipArea

public Area getShipArea()
Description copied from interface: BoardableShip
Space ships are unique in having an Item stand-in for dirt-side access, as well as an Area object. This method returns the area object that represents the contents of the ship.

Specified by:
getShipArea in interface BoardableShip
Overrides:
getShipArea in class StdBoardable
Returns:
the official area version of this ship

dockHere

public void dockHere(Room R)
Description copied from interface: BoardableShip
Designates that this ship is landed and docked in the given planetary room.

Specified by:
dockHere in interface BoardableShip
Overrides:
dockHere in class StdBoardable
Parameters:
R - the coordinate toom in which the ship is docked.

unDock

public Room unDock(boolean moveToOutside)
Description copied from interface: BoardableShip
Designates that this ship is no longer docked, and whether it should also be moved into its na

Specified by:
unDock in interface BoardableShip
Overrides:
unDock in class StdBoardable
Parameters:
moveToOutside - true to put in space/ocean, or false to leave in limbo
Returns:
one of the internal rooms that was connected to the dock

renameShip

public void renameShip(java.lang.String newName)
Description copied from interface: BoardableShip
Renames the ship to something else

Specified by:
renameShip in interface BoardableShip
Overrides:
renameShip in class StdBoardable
Parameters:
newName - the new ship name

okMessage

public boolean okMessage(Environmental myHost,
                         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 StdBoardable
Parameters:
myHost - 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()

executeMsg

public void executeMsg(Environmental myHost,
                       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 StdBoardable
Parameters:
myHost - either the initiator of the event, or the host of this object
msg - the CMMsg that needs to be executed
See Also:
CMMsg

findNearestDocks

protected LocationRoom findNearestDocks(Room R)
Overrides:
findNearestDocks in class StdBoardable

stopThisShip

protected void stopThisShip(MOB mob)

getBounds

public BoundedObject.BoundedCube getBounds()
Specified by:
getBounds in interface BoundedObject

powerCapacity

public long powerCapacity()
Description copied from interface: Electronics
Gets the maximum amount of capacitance supported by this electrical item. This is the maximum power the item can store up and utilize before it shuts off. Only the item itself knows how much it wants to use at any particular time.

Specified by:
powerCapacity in interface Electronics
Returns:
the maximum amount of stored power capacity
See Also:
Electronics.setPowerCapacity(long)

setPowerCapacity

public void setPowerCapacity(long capacity)
Description copied from interface: Electronics
Sets the maximum amount of capacitance supported by this electrical item. This is the maximum power the item can store up and utilize before it shuts off. Only the item itself knows how much it wants to use at any particular time.

Specified by:
setPowerCapacity in interface Electronics
Parameters:
capacity - the maximum amount of stored power capacity
See Also:
Electronics.powerCapacity()

powerRemaining

public long powerRemaining()
Description copied from interface: Electronics
Gets the amount of power capacitance remaining in this electrical item. The item will continue to use this power until it doesn't have enough to operate, and then turn off.

Specified by:
powerRemaining in interface Electronics
Returns:
the amount of power capacitance remaining
See Also:
Electronics.setPowerRemaining(long)

powerNeeds

public int powerNeeds()
Description copied from interface: Electronics
Returns the immediate power needs of this electrical item. Typically powerCapacity - powerAvailable

Specified by:
powerNeeds in interface Electronics
Returns:
the amount of power this item can still absorb
See Also:
Electronics.powerRemaining(), Electronics.powerCapacity()

setPowerRemaining

public void setPowerRemaining(long remaining)
Description copied from interface: Electronics
Sets the amount of power capacitance remaining in this electrical item. The item will continue to use this power until it doesn't have enough to operate, and then turn off.

Specified by:
setPowerRemaining in interface Electronics
Parameters:
remaining - the amount of power capacitance remaining
See Also:
Electronics.powerRemaining()

activate

public void activate(boolean truefalse)
Description copied from interface: Electronics
Sets whether this electrical item is "turned on". An activated item can do the stuff it is supposed to, but off it cannot.

Specified by:
activate in interface Electronics
Parameters:
truefalse - true to activate, false to deactivate
See Also:
Electronics.activated()

sendComputerMessage

protected void sendComputerMessage(MOB mob,
                                   CMMsg msg)

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

setShipFlag

public void setShipFlag(SpaceShip.ShipFlag flag,
                        boolean setFlag)
Description copied from interface: SpaceShip
Sets one of the ship flags

Specified by:
setShipFlag in interface SpaceShip
Parameters:
flag - the flag to set or clear
setFlag - the flag value
See Also:
SpaceShip.ShipFlag, SpaceShip.getShipFlag(ShipFlag)

getShipFlag

public boolean getShipFlag(SpaceShip.ShipFlag flag)
Description copied from interface: SpaceShip
Gets one of the ship flags

Specified by:
getShipFlag in interface SpaceShip
Parameters:
flag - the flag to set or clear
Returns:
flagValue the flag value
See Also:
SpaceShip.ShipFlag, SpaceShip.setShipFlag(ShipFlag, boolean)

getShipSpaceObject

public SpaceObject getShipSpaceObject()
Description copied from interface: SpaceShip
Space ships are unique in having an Item stand-in for planet-side access, as well as an Area object. This method returns the object that resides in the official space grid.

Specified by:
getShipSpaceObject in interface SpaceShip
Returns:
the official space version of this ship

activated

public boolean activated()
Description copied from interface: Electronics
Gets whether this electrical item is "turned on". An activated item can do the stuff it is supposed to, but off it cannot.

Specified by:
activated in interface Electronics
Returns:
whether this electrical item is "turned on"
See Also:
Electronics.activate(boolean)

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()

getManufacturerName

public java.lang.String getManufacturerName()
Description copied from interface: Electronics
Gets the Manufacturer ID/Name that made this electrical item. This is important because benefits and detriments can come along with the manufacturer.

Specified by:
getManufacturerName in interface Electronics
Returns:
the Manufacturer ID/Name that made this
See Also:
Electronics.setManufacturerName(String), Manufacturer

setManufacturerName

public void setManufacturerName(java.lang.String name)
Description copied from interface: Electronics
Sets the Manufacturer ID/Name that made this electrical item. This is important because benefits and detriments can come along with the manufacturer.

Specified by:
setManufacturerName in interface Electronics
Parameters:
name - the Manufacturer ID/Name that made this
See Also:
Electronics.getManufacturerName(), Electronics.getFinalManufacturer(), Manufacturer

getMass

public long getMass()
Description copied from interface: SpaceObject
Returns the mass of this object, derived from its radius and type, or perhaps from other things. Either way, its derived. The mass of space ships is what it is, but the mass of planets will be off by about 15 zeroes, as there just aren't enough bits.

Specified by:
getMass in interface SpaceObject
Returns:
the mass of this object

getFinalManufacturer

public Manufacturer getFinalManufacturer()
Description copied from interface: Electronics
Returns the Manufacturer object of the manufacturer that made this electrical item. This is important because benefits and detriments can come along with the manufacturer.

Specified by:
getFinalManufacturer in interface Electronics
Returns:
the Manufacturer that made this electrical item
See Also:
Electronics.getManufacturerName(), Electronics.setManufacturerName(String), Manufacturer

coordinates

public long[] coordinates()
Description copied from interface: SpaceObject
The current absolute coordinates of the object

Specified by:
coordinates in interface SpaceObject
Returns:
3 dimensional array of the coordinates

direction

public double[] direction()
Description copied from interface: SpaceObject
The direction of travel of this object in radians.

Specified by:
direction in interface SpaceObject
Returns:
2 dimensional array for the direction of movement

roll

public double roll()
Description copied from interface: SpaceShip
The full 360 orientation of the top of the object in radians.

Specified by:
roll in interface SpaceShip
Returns:
radian for the direction of orientation

setRoll

public void setRoll(double dir)
Description copied from interface: SpaceShip
Sets the full 360 orientation of the top of the object in radians.

Specified by:
setRoll in interface SpaceShip
Parameters:
dir - radian for the direction of orientation

facing

public double[] facing()
Description copied from interface: SpaceShip
The direction of facing of this object in radians.

Specified by:
facing in interface SpaceShip
Returns:
2 dimensional array for the direction of facing

setFacing

public void setFacing(double[] dir)
Description copied from interface: SpaceShip
Sets the direction of facing of this object in radians.

Specified by:
setFacing in interface SpaceShip
Parameters:
dir - 2 dimensional array for the direction of facing

knownTarget

public SpaceObject knownTarget()
Description copied from interface: SpaceObject
If this object is targeting another space object as a destination, this will return it

Specified by:
knownTarget in interface SpaceObject
Returns:
the target destination

setKnownTarget

public void setKnownTarget(SpaceObject O)
Description copied from interface: SpaceObject
If this object is targeting another space object as a destination, this will set it

Specified by:
setKnownTarget in interface SpaceObject
Parameters:
O - the target destination

setCoords

public void setCoords(long[] coords)
Description copied from interface: SpaceObject
Sets the current absolute coordinates of the object

Specified by:
setCoords in interface SpaceObject
Parameters:
coords - 3 dimensional array of the coordinates in space

setDirection

public void setDirection(double[] dir)
Description copied from interface: SpaceObject
Sets the direction of travel of this object in radians. direction[0] less than or equal to PI direction[1] less than or equal to 2PI

Specified by:
setDirection in interface SpaceObject
Parameters:
dir - 2 dimensional array for the direction of movement

speed

public double speed()
Description copied from interface: SpaceObject
The speed of the object through space

Specified by:
speed in interface SpaceObject
Returns:
the speed

setSpeed

public void setSpeed(double v)
Description copied from interface: SpaceObject
Sets the speed of the object through space

Specified by:
setSpeed in interface SpaceObject
Parameters:
v - the speed

knownSource

public SpaceObject knownSource()
Description copied from interface: SpaceObject
The source object from which this space object is travelling from

Specified by:
knownSource in interface SpaceObject
Returns:
the source of this object

setKnownSource

public void setKnownSource(SpaceObject O)
Description copied from interface: SpaceObject
Sets the source object from which this space object is travelling from

Specified by:
setKnownSource in interface SpaceObject
Parameters:
O - the source of this object

radius

public long radius()
Description copied from interface: SpaceObject
The current radius of the object

Specified by:
radius in interface SpaceObject
Returns:
the radius, in decameters

setRadius

public void setRadius(long radius)
Description copied from interface: SpaceObject
Set the current radius of the object

Specified by:
setRadius in interface SpaceObject
Parameters:
radius - the current radius of the object

getOMLCoeff

public double getOMLCoeff()
Description copied from interface: SpaceShip
The Outer Mold Line coefficient -- how streamlined are you?

Specified by:
getOMLCoeff in interface SpaceShip
Returns:
the coefficient, from 0.05-0.3

setOMLCoeff

public void setOMLCoeff(double coeff)
Description copied from interface: SpaceShip
Set the Outer Mold Line coefficient -- how streamlined are you?

Specified by:
setOMLCoeff in interface SpaceShip
Parameters:
coeff - the Outer Mold Line coefficient

getStat

public java.lang.String getStat(java.lang.String code)
Description copied from interface: Modifiable
An alternative means of retreiving the values of those fields on this object which are modifiable at run-time by builders. See getStatCodes() for possible values for the code passed to this method. Values returned are always strings, even if the field itself is numeric or a list.

Specified by:
getStat in interface Modifiable
Overrides:
getStat in class StdItem
Parameters:
code - the name of the field to read.
Returns:
the value of the field read
See Also:
Modifiable.getStatCodes()

setStat

public void setStat(java.lang.String code,
                    java.lang.String val)
Description copied from interface: Modifiable
An alternative means of setting the values of those fields on this object which are modifiable at run-time by builders. See getStatCodes() for possible values for the code passed to this method. The value passed in is always a string, even if the field itself is numeric or a list.

Specified by:
setStat in interface Modifiable
Overrides:
setStat in class StdItem
Parameters:
code - the name of the field to set
val - the value to set the field to
See Also:
Modifiable.getStatCodes()

getCodeNum

protected int getCodeNum(java.lang.String code)
Overrides:
getCodeNum in class StdItem

getStatCodes

public java.lang.String[] getStatCodes()
Description copied from interface: Modifiable
Returns an array of the string names of those fields which are modifiable on this object at run-time by builders.

Specified by:
getStatCodes in interface Modifiable
Overrides:
getStatCodes in class StdItem
Returns:
list of the fields which may be set.
See Also:
Modifiable.getStat(String), Modifiable.setStat(String, String)

sameAs

public boolean sameAs(Environmental E)
Description copied from interface: Environmental
Whether this object instance is functionally identical to the object passed in. Works by repeatedly calling getStat on both objects and comparing the values.

Specified by:
sameAs in interface Environmental
Overrides:
sameAs in class StdItem
Parameters:
E - the object to compare this one to
Returns:
whether this object is the same as the one passed in
See Also:
Modifiable.getStatCodes(), Modifiable.getStat(String)