com.planet_ink.coffee_mud.Libraries.interfaces
Interface TechLibrary

All Superinterfaces:
java.lang.Cloneable, CMLibrary, CMObject, java.lang.Comparable<CMObject>
All Known Implementing Classes:
GroundWired

public interface TechLibrary
extends CMLibrary


Method Summary
 void addManufacturer(Manufacturer manufacturer)
          Adds and saves a new manufacturer to the list.
 void delManufacturer(Manufacturer manufacturer)
          Removes a new manufacturer from the list.
 void fixItemTechLevel(Electronics I, int newTechLevel)
          "Fixes" the tech level of the given item by making sure it's manufacturer is non-random, and by assigning a random tech level within the valid range, and modifying its name and displaytext to reflect the new tech level
 java.util.Iterator<Room> getComputerRooms(java.lang.String key)
          Return all the rooms containing computers in the given circuit key.
 java.util.Iterator<Computer> getComputers(java.lang.String key)
          Return all the computers in the given circuit key.
 Manufacturer getDefaultManufacturer()
          Retrieves the default manufacturer for new products
 java.lang.String getElectronicsKey(CMObject o)
          Returns the appropriate electronics key for this electronic item, area, or room.
 int getGlobalTechLevel()
          Returns the global tech level
 double getGravityForce(SpaceObject S, SpaceObject cO)
          If the two given objects are within an appropriate distance from each other, this will return the correct amount of acceleration g-force applied by the second object to the first.
 java.util.List<Electronics> getMakeRegisteredElectronics(java.lang.String key)
          For the given key, return an eclusive list of all the electronics that belong to that key.
 java.util.List<java.lang.String> getMakeRegisteredKeys()
          Returns a new exclusive list of all the registered electronics keys being processed.
 Manufacturer getManufacturer(java.lang.String name)
          Retrieves the manufacturer of the given name, or null if it is not found.
 Manufacturer getManufacturerOf(Electronics E, java.lang.String name)
          Retrieves the manufacturer of the given name, or null if it is not found.
 int getRandomGlobalTechLevel()
          Returns a random gaussian-distributed tech level from the current low tech level bound to bound+10.
 boolean isCurrentActive(java.lang.String key)
          Returns whether the currents at the given key are still active.
 java.util.Iterator<Manufacturer> manufacterers()
          Returns an iterator of manufacturers
 java.lang.String registerElectrics(Electronics E, java.lang.String oldKey)
          Registers an electronic component that belongs in a complex circuitry, like a panel or a generator
 boolean seekBatteryPower(ElecPanel E, java.lang.String key)
          Certain Key Systems may automatically force batteries in their circuit to activate in order to provide that system with power.
 void unregisterAllElectronics(java.lang.String oldKey)
          Unregisters all electronic components that belonged in a complex circuitry, like a panel or a generator, of the given key.
 void unregisterElectronics(Electronics E, java.lang.String oldKey)
          Unregisters an electronic component that belonged in a complex circuitry, like a panel or a generator.
 void updateManufacturer(Manufacturer manufacturer)
          Updates a new manufacturer in the list.
 
Methods inherited from interface com.planet_ink.coffee_mud.Libraries.interfaces.CMLibrary
activate, getServiceClient, L, propertiesLoaded, shutdown
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.CMObject
copyOf, ID, initializeClass, name, newInstance
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

getElectronicsKey

java.lang.String getElectronicsKey(CMObject o)
Returns the appropriate electronics key for this electronic item, area, or room. It represents the electronical currents that tie technology together.

Parameters:
o - the object to inspect
Returns:
the key to use, or null if none can be found

unregisterElectronics

void unregisterElectronics(Electronics E,
                           java.lang.String oldKey)
Unregisters an electronic component that belonged in a complex circuitry, like a panel or a generator.

Parameters:
E - the electronic component to unregister
oldKey - the last key registered to this device

unregisterAllElectronics

void unregisterAllElectronics(java.lang.String oldKey)
Unregisters all electronic components that belonged in a complex circuitry, like a panel or a generator, of the given key.

Parameters:
oldKey - the last key registered to this device

registerElectrics

java.lang.String registerElectrics(Electronics E,
                                   java.lang.String oldKey)
Registers an electronic component that belongs in a complex circuitry, like a panel or a generator

Parameters:
E - the electronic component to register
oldKey - the last key registered to this device
Returns:
the new key assigned to this item (or old key)

isCurrentActive

boolean isCurrentActive(java.lang.String key)
Returns whether the currents at the given key are still active. Some currents go inactive when players leave the game, or their areas may be suspended by the system.

Parameters:
key - the current key
Returns:
true if the area is active

getMakeRegisteredKeys

java.util.List<java.lang.String> getMakeRegisteredKeys()
Returns a new exclusive list of all the registered electronics keys being processed.

Returns:
the list of keys

getMakeRegisteredElectronics

java.util.List<Electronics> getMakeRegisteredElectronics(java.lang.String key)
For the given key, return an eclusive list of all the electronics that belong to that key.

Parameters:
key - the key to return electronics for
Returns:
the list of electronic object of that key

seekBatteryPower

boolean seekBatteryPower(ElecPanel E,
                         java.lang.String key)
Certain Key Systems may automatically force batteries in their circuit to activate in order to provide that system with power. This will make that attempt.

Parameters:
E - the key device to seek power
key - this devices key
Returns:
true if an attempt to give power was made, false otherwise.

getDefaultManufacturer

Manufacturer getDefaultManufacturer()
Retrieves the default manufacturer for new products

Returns:
the default manufacturer for new products

addManufacturer

void addManufacturer(Manufacturer manufacturer)
Adds and saves a new manufacturer to the list.

Parameters:
manufacturer - the one to add

delManufacturer

void delManufacturer(Manufacturer manufacturer)
Removes a new manufacturer from the list.

Parameters:
manufacturer - the one to remove

updateManufacturer

void updateManufacturer(Manufacturer manufacturer)
Updates a new manufacturer in the list.

Parameters:
manufacturer - the one to update

getManufacturer

Manufacturer getManufacturer(java.lang.String name)
Retrieves the manufacturer of the given name, or null if it is not found. Can not handle RANDOM!!

Parameters:
name - the manufacturer to fetch
Returns:
the manufacturer found, or null

getManufacturerOf

Manufacturer getManufacturerOf(Electronics E,
                               java.lang.String name)
Retrieves the manufacturer of the given name, or null if it is not found. If random is sent, it will find a random manufacturer for the given item.

Parameters:
E - for random manufacturers, the item to check
name - the manufacturer to fetch
Returns:
the manufacturer found, or null

manufacterers

java.util.Iterator<Manufacturer> manufacterers()
Returns an iterator of manufacturers

Returns:
the set to return

getComputerRooms

java.util.Iterator<Room> getComputerRooms(java.lang.String key)
Return all the rooms containing computers in the given circuit key.

Parameters:
key - the circuit key
Returns:
an iterator of rooms

getComputers

java.util.Iterator<Computer> getComputers(java.lang.String key)
Return all the computers in the given circuit key.

Parameters:
key - the circuit key
Returns:
an iterator of computers

getRandomGlobalTechLevel

int getRandomGlobalTechLevel()
Returns a random gaussian-distributed tech level from the current low tech level bound to bound+10.

Returns:
a random valid tech level;

getGlobalTechLevel

int getGlobalTechLevel()
Returns the global tech level

Returns:
the global tech level

fixItemTechLevel

void fixItemTechLevel(Electronics I,
                      int newTechLevel)
"Fixes" the tech level of the given item by making sure it's manufacturer is non-random, and by assigning a random tech level within the valid range, and modifying its name and displaytext to reflect the new tech level

Parameters:
I - An electronics item that needs fixing
newTechLevel - the new tech level

getGravityForce

double getGravityForce(SpaceObject S,
                       SpaceObject cO)
If the two given objects are within an appropriate distance from each other, this will return the correct amount of acceleration g-force applied by the second object to the first. typically <= 1G

Parameters:
S - the object being pulled
cO - the object pulling
Returns:
the amount of gravity force, or 0