CMObject, Tickable, CMLibrary, TechLibrary, java.lang.Cloneable, java.lang.Comparable<CMObject>public class GroundWired extends StdLibrary implements TechLibrary
| Modifier and Type | Class | Description |
|---|---|---|
protected static class |
GroundWired.ElecList |
|
protected static class |
GroundWired.WireHookups |
| Modifier and Type | Field | Description |
|---|---|---|
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 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,GroundWired.WireHookups> |
sets |
idConverterisDebugging, name, serviceClient, tickStatusSTATUS_AFFECT, STATUS_ALIVE, STATUS_BEHAVIOR, STATUS_CLASS, STATUS_DEAD, STATUS_END, STATUS_FIGHT, STATUS_MISC, STATUS_MISC2, STATUS_MISC3, STATUS_MISC4, STATUS_MISC5, STATUS_MISC6, STATUS_MISC7, STATUS_NOT, STATUS_OTHER, STATUS_RACE, STATUS_REBIRTH, STATUS_SCRIPT, STATUS_START, STATUS_WEATHER, TICKID_AREA, TICKID_BALLISTICK, TICKID_CLAN, TICKID_CLANITEM, TICKID_DEADBODY_DECAY, TICKID_ELECTRONICS, TICKID_EMAIL, TICKID_EVENT, TICKID_EXIT_BEHAVIOR, TICKID_EXIT_REOPEN, TICKID_ITEM_BEHAVIOR, TICKID_ITEM_BOUNCEBACK, TICKID_LIGHT_FLICKERS, TICKID_LIVEAUCTION, TICKID_LONGERMASK, TICKID_MISCELLANEOUS, TICKID_MOB, TICKID_PROPERTY_SPECIAL, TICKID_QUEST, TICKID_READYTOSTOP, TICKID_ROOM_BEHAVIOR, TICKID_ROOM_ITEM_REJUV, TICKID_SHORTERMASK, TICKID_SOLITARYMASK, TICKID_SPECIALCOMBAT, TICKID_SPECIALMANEUVER, TICKID_SPELL_AFFECT, TICKID_SUPPORT, TICKID_TIMEAUCTION, TICKID_TRAP_DESTRUCTION, TICKID_TRAP_RESET| Constructor | Description |
|---|---|
GroundWired() |
| Modifier and Type | Method | Description |
|---|---|---|
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.
|
void |
executeMsg(java.lang.String oldKey,
Technical.TechCommand command,
Environmental myHost,
CMMsg msg) |
For objects connected ONLY via their electronics, this will allow
tech messages to be transferred between them.
|
protected Area |
fillCurrentLists(java.lang.String key,
java.util.List<PowerGenerator> generators,
java.util.List<PowerSource> batteries,
java.util.List<ElecPanel> panels) |
|
void |
fixItemTechLevel(Technical 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
|
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(Technical 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
|
boolean |
okMessage(java.lang.String oldKey,
Technical.TechCommand command,
Environmental myHost,
CMMsg msg) |
For objects connected ONLY via their electronics, this will allow
tech messages to be transferred between them.
|
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
|
java.lang.String |
registerElectrics(Electronics E,
java.lang.String oldKey,
Technical.TechCommand[] listenFors) |
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() |
|
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.
|
L, propertiesLoadedcopyOf, name, newInstanceclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcheckDatabase, compareTo, copyOf, getTickStatus, L, name, newInstance, propertiesLoaded, setThreadStatusprotected Manufacturer defaultManufacturer
protected final java.util.Map<java.lang.String,Manufacturer> manufacturers
protected final java.util.Map<java.lang.String,GroundWired.WireHookups> sets
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
public java.lang.String ID()
CMObjectID in interface CMObjectID in class StdLibrarypublic void initializeClass()
CMObjectinitializeClass in interface CMObjectinitializeClass in class StdLibrarypublic int getGlobalTechLevel()
TechLibrarygetGlobalTechLevel in interface TechLibrarypublic int getRandomGlobalTechLevel()
TechLibrarygetRandomGlobalTechLevel in interface TechLibraryprotected void bumpTechLevel()
public void fixItemTechLevel(Technical I, int newTechLevel)
TechLibraryfixItemTechLevel in interface TechLibraryI - An electronics item that needs fixingnewTechLevel - the new tech levelpublic java.lang.String getElectronicsKey(CMObject o)
TechLibrarygetElectronicsKey in interface TechLibraryo - the object to inspectpublic java.lang.String registerElectrics(Electronics E, java.lang.String oldKey)
TechLibraryregisterElectrics in interface TechLibraryE - the electronic component to registeroldKey - the last key registered to this devicepublic java.lang.String registerElectrics(Electronics E, java.lang.String oldKey, Technical.TechCommand[] listenFors)
TechLibraryregisterElectrics in interface TechLibraryE - the electronic component to registeroldKey - the last key registered to this devicelistenFors - TechCommands to listen for, or nullpublic java.util.List<Electronics> getMakeRegisteredElectronics(java.lang.String key)
TechLibrarygetMakeRegisteredElectronics in interface TechLibrarykey - the key to return electronics forpublic java.util.List<java.lang.String> getMakeRegisteredKeys()
TechLibrarygetMakeRegisteredKeys in interface TechLibrarypublic boolean okMessage(java.lang.String oldKey,
Technical.TechCommand command,
Environmental myHost,
CMMsg msg)
TechLibraryokMessage in interface TechLibraryoldKey - the electronics keycommand - the tech command in questionmyHost - message hostmsg - the message to sendTechLibrary.executeMsg(String, TechCommand, Environmental, CMMsg)public void executeMsg(java.lang.String oldKey,
Technical.TechCommand command,
Environmental myHost,
CMMsg msg)
TechLibraryexecuteMsg in interface TechLibraryoldKey - the electronics keycommand - the tech command in questionmyHost - message hostmsg - the message to sendTechLibrary.okMessage(String, TechCommand, Environmental, CMMsg)public void unregisterElectronics(Electronics E, java.lang.String oldKey)
TechLibraryunregisterElectronics in interface TechLibraryE - the electronic component to unregisteroldKey - the last key registered to this devicepublic void unregisterAllElectronics(java.lang.String oldKey)
TechLibraryunregisterAllElectronics in interface TechLibraryoldKey - the last key registered to this devicepublic TickClient getServiceClient()
CMLibrarygetServiceClient in interface CMLibrarygetServiceClient in class StdLibraryTickClientpublic java.util.Iterator<Computer> getComputers(java.lang.String key)
TechLibrarygetComputers in interface TechLibrarykey - the circuit keypublic java.util.Iterator<Room> getComputerRooms(java.lang.String key)
TechLibrarygetComputerRooms in interface TechLibrarykey - the circuit keyprotected CMMsg getPowerMsg(int powerAmt)
public boolean activate()
CMLibraryactivate in interface CMLibraryactivate in class StdLibraryCMLibrary.shutdown()public boolean tick(Tickable ticking, int tickID)
Tickabletick in interface Tickabletick in class StdLibraryticking - a reference to this Tickable objecttickID - the TICKID_ constant describing this periodic call, as defined in TickableTickable,
ServiceEngine,
TickableGrouppublic boolean shutdown()
CMLibraryshutdown 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.Exceptionprotected 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)
TechLibraryisCurrentActive in interface TechLibrarykey - the current keyprotected void runElectricCurrent(java.lang.String key)
public boolean seekBatteryPower(ElecPanel E, java.lang.String key)
TechLibraryseekBatteryPower in interface TechLibraryE - the key device to seek powerkey - this devices keyprotected void runElectricCurrents()
public Manufacturer getDefaultManufacturer()
TechLibrarygetDefaultManufacturer in interface TechLibrarypublic void addManufacturer(Manufacturer manufacturer)
TechLibraryaddManufacturer in interface TechLibrarymanufacturer - the one to addpublic void delManufacturer(Manufacturer manufacturer)
TechLibrarydelManufacturer in interface TechLibrarymanufacturer - the one to removepublic void updateManufacturer(Manufacturer manufacturer)
TechLibraryupdateManufacturer in interface TechLibrarymanufacturer - the one to updatepublic Manufacturer getManufacturer(java.lang.String name)
TechLibrarygetManufacturer in interface TechLibraryname - the manufacturer to fetchpublic Manufacturer getManufacturerOf(Technical E, java.lang.String name)
TechLibrarygetManufacturerOf in interface TechLibraryE - for random manufacturers, the item to checkname - the manufacturer to fetchpublic java.util.Iterator<Manufacturer> manufacterers()
TechLibrarymanufacterers in interface TechLibraryprotected java.lang.String getManufacturersFilename()
protected void saveAllManufacturers()
protected void loadAllManufacturers()