|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.planet_ink.coffee_mud.Libraries.StdLibrary
com.planet_ink.coffee_mud.Libraries.GroundWired
public class GroundWired
| Field Summary | |
|---|---|
protected static Converter<java.lang.ref.WeakReference<Electronics>,Computer> |
computerConverter
|
protected static Filterer<java.lang.ref.WeakReference<Electronics>> |
computerFilterer
|
protected static Converter<Computer,Room> |
computerRoomConverter
|
protected java.util.Map<PowerGenerator,Pair<java.util.List<PowerSource>,java.util.List<Electronics>>> |
currents
|
protected Manufacturer |
defaultManufacturer
|
protected static java.util.Iterator<Computer> |
emptyComputerIterator
|
protected static java.util.Iterator<Room> |
emptyComputerRoomIterator
|
protected static java.util.List<PowerGenerator> |
emptyGeneratorList
|
int |
globalTechLevel
|
long |
globalTechReachedOn
|
protected java.util.Map<java.lang.String,Manufacturer> |
manufacturers
|
protected java.util.concurrent.atomic.AtomicInteger |
nextKey
|
protected CMMsg |
powerMsg
|
protected java.util.Map<java.lang.String,java.util.LinkedList<java.lang.ref.WeakReference<Electronics>>> |
sets
|
| Fields inherited from class com.planet_ink.coffee_mud.Libraries.StdLibrary |
|---|
isDebugging, name, serviceClient, tickStatus |
| Constructor Summary | |
|---|---|
GroundWired()
|
|
| Method Summary | |
|---|---|
boolean |
activate()
Activates the library. |
void |
addManufacturer(Manufacturer manufacturer)
Adds and saves a new manufacturer to the list. |
protected void |
bumpTechLevel()
|
void |
delManufacturer(Manufacturer manufacturer)
Removes a new manufacturer from the list. |
protected Area |
fillCurrentLists(java.lang.String key,
java.util.List<PowerGenerator> generators,
java.util.List<PowerSource> batteries,
java.util.List<ElecPanel> panels)
|
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. |
protected java.lang.String |
getManufacturersFilename()
|
protected CMMsg |
getPowerMsg(int powerAmt)
|
int |
getRandomGlobalTechLevel()
Returns a random gaussian-distributed tech level from the current low tech level bound to bound+10. |
TickClient |
getServiceClient()
If this library has a service thread, this method returns the TickClient object associated with that service. |
java.lang.String |
ID()
The CoffeeMud Java Class ID shared by all instances of this object. |
void |
initializeClass()
Called ONCE after all objects are loaded, but before the map is read in during initialization. |
boolean |
isCurrentActive(java.lang.String key)
Returns whether the currents at the given key are still active. |
protected void |
loadAllManufacturers()
|
java.util.Iterator<Manufacturer> |
manufacterers()
Returns an iterator of manufacturers |
protected void |
processElectricCurrents(java.lang.String key,
java.util.List<PowerGenerator> generators,
java.util.List<PowerSource> batteries,
java.util.List<ElecPanel> panels)
|
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 |
protected void |
runElectricCurrent(java.lang.String key)
|
protected void |
runElectricCurrents()
|
void |
runSpace()
|
protected void |
saveAllManufacturers()
|
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. |
boolean |
shutdown()
Shuts down the library. |
boolean |
tick(Tickable ticking,
int tickID)
this is the method which is called periodically by the threading engine. |
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 class com.planet_ink.coffee_mud.Libraries.StdLibrary |
|---|
checkDatabase, compareTo, copyOf, getTickStatus, L, name, newInstance, propertiesLoaded, setThreadStatus |
| 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.Libraries.interfaces.CMLibrary |
|---|
L, propertiesLoaded |
| Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.CMObject |
|---|
copyOf, name, newInstance |
| Methods inherited from interface java.lang.Comparable |
|---|
compareTo |
| Field Detail |
|---|
protected Manufacturer defaultManufacturer
protected final java.util.Map<java.lang.String,Manufacturer> manufacturers
protected final java.util.Map<java.lang.String,java.util.LinkedList<java.lang.ref.WeakReference<Electronics>>> sets
protected final java.util.Map<PowerGenerator,Pair<java.util.List<PowerSource>,java.util.List<Electronics>>> currents
protected static final java.util.List<PowerGenerator> emptyGeneratorList
protected final java.util.concurrent.atomic.AtomicInteger nextKey
public int globalTechLevel
public long globalTechReachedOn
protected CMMsg powerMsg
protected static final java.util.Iterator<Computer> emptyComputerIterator
protected static final java.util.Iterator<Room> emptyComputerRoomIterator
protected static final Filterer<java.lang.ref.WeakReference<Electronics>> computerFilterer
protected static final Converter<java.lang.ref.WeakReference<Electronics>,Computer> computerConverter
protected static final Converter<Computer,Room> computerRoomConverter
| Constructor Detail |
|---|
public GroundWired()
| Method Detail |
|---|
public java.lang.String ID()
CMObject
ID in interface CMObjectID in class StdLibrarypublic void initializeClass()
CMObject
initializeClass in interface CMObjectinitializeClass in class StdLibrarypublic int getGlobalTechLevel()
TechLibrary
getGlobalTechLevel in interface TechLibrarypublic int getRandomGlobalTechLevel()
TechLibrary
getRandomGlobalTechLevel in interface TechLibraryprotected void bumpTechLevel()
public void fixItemTechLevel(Electronics I,
int newTechLevel)
TechLibrary
fixItemTechLevel in interface TechLibraryI - An electronics item that needs fixingnewTechLevel - the new tech levelpublic java.lang.String getElectronicsKey(CMObject o)
TechLibrary
getElectronicsKey in interface TechLibraryo - the object to inspect
public java.lang.String registerElectrics(Electronics E,
java.lang.String oldKey)
TechLibrary
registerElectrics in interface TechLibraryE - the electronic component to registeroldKey - the last key registered to this device
public java.util.List<Electronics> getMakeRegisteredElectronics(java.lang.String key)
TechLibrary
getMakeRegisteredElectronics in interface TechLibrarykey - the key to return electronics for
public java.util.List<java.lang.String> getMakeRegisteredKeys()
TechLibrary
getMakeRegisteredKeys in interface TechLibrary
public void unregisterElectronics(Electronics E,
java.lang.String oldKey)
TechLibrary
unregisterElectronics in interface TechLibraryE - the electronic component to unregisteroldKey - the last key registered to this devicepublic void unregisterAllElectronics(java.lang.String oldKey)
TechLibrary
unregisterAllElectronics in interface TechLibraryoldKey - the last key registered to this devicepublic TickClient getServiceClient()
CMLibrary
getServiceClient in interface CMLibrarygetServiceClient in class StdLibraryTickClientpublic java.util.Iterator<Computer> getComputers(java.lang.String key)
TechLibrary
getComputers in interface TechLibrarykey - the circuit key
public java.util.Iterator<Room> getComputerRooms(java.lang.String key)
TechLibrary
getComputerRooms in interface TechLibrarykey - the circuit key
protected CMMsg getPowerMsg(int powerAmt)
public boolean activate()
CMLibrary
activate in interface CMLibraryactivate in class StdLibraryCMLibrary.shutdown()
public double getGravityForce(SpaceObject S,
SpaceObject cO)
TechLibrary
getGravityForce in interface TechLibraryS - the object being pulledcO - the object pulling
public void runSpace()
public boolean tick(Tickable ticking,
int tickID)
Tickable
tick in interface Tickabletick in class StdLibraryticking - a reference to this Tickable objecttickID - the TICKID_ constant describing this periodic call, as defined in Tickable
Tickable,
ServiceEngine,
TickableGrouppublic boolean shutdown()
CMLibrary
shutdown in interface CMLibraryshutdown in class StdLibraryCMLibrary.activate()
protected void processElectricCurrents(java.lang.String key,
java.util.List<PowerGenerator> generators,
java.util.List<PowerSource> batteries,
java.util.List<ElecPanel> panels)
throws java.lang.Exception
java.lang.Exception
protected Area fillCurrentLists(java.lang.String key,
java.util.List<PowerGenerator> generators,
java.util.List<PowerSource> batteries,
java.util.List<ElecPanel> panels)
public boolean isCurrentActive(java.lang.String key)
TechLibrary
isCurrentActive in interface TechLibrarykey - the current key
protected void runElectricCurrent(java.lang.String key)
public boolean seekBatteryPower(ElecPanel E,
java.lang.String key)
TechLibrary
seekBatteryPower in interface TechLibraryE - the key device to seek powerkey - this devices key
protected void runElectricCurrents()
public Manufacturer getDefaultManufacturer()
TechLibrary
getDefaultManufacturer in interface TechLibrarypublic void addManufacturer(Manufacturer manufacturer)
TechLibrary
addManufacturer in interface TechLibrarymanufacturer - the one to addpublic void delManufacturer(Manufacturer manufacturer)
TechLibrary
delManufacturer in interface TechLibrarymanufacturer - the one to removepublic void updateManufacturer(Manufacturer manufacturer)
TechLibrary
updateManufacturer in interface TechLibrarymanufacturer - the one to updatepublic Manufacturer getManufacturer(java.lang.String name)
TechLibrary
getManufacturer in interface TechLibraryname - the manufacturer to fetch
public Manufacturer getManufacturerOf(Electronics E,
java.lang.String name)
TechLibrary
getManufacturerOf in interface TechLibraryE - for random manufacturers, the item to checkname - the manufacturer to fetch
public java.util.Iterator<Manufacturer> manufacterers()
TechLibrary
manufacterers in interface TechLibraryprotected java.lang.String getManufacturersFilename()
protected void saveAllManufacturers()
protected void loadAllManufacturers()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||