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 |
idConverter
isDebugging, name, serviceClient, tickStatus
STATUS_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, propertiesLoaded
copyOf, name, newInstance
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkDatabase, compareTo, copyOf, getTickStatus, L, name, newInstance, propertiesLoaded, setThreadStatus
protected 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()
CMObject
ID
in interface CMObject
ID
in class StdLibrary
public void initializeClass()
CMObject
initializeClass
in interface CMObject
initializeClass
in class StdLibrary
public int getGlobalTechLevel()
TechLibrary
getGlobalTechLevel
in interface TechLibrary
public int getRandomGlobalTechLevel()
TechLibrary
getRandomGlobalTechLevel
in interface TechLibrary
protected void bumpTechLevel()
public void fixItemTechLevel(Technical I, int newTechLevel)
TechLibrary
fixItemTechLevel
in interface TechLibrary
I
- An electronics item that needs fixingnewTechLevel
- the new tech levelpublic java.lang.String getElectronicsKey(CMObject o)
TechLibrary
getElectronicsKey
in interface TechLibrary
o
- the object to inspectpublic java.lang.String registerElectrics(Electronics E, java.lang.String oldKey)
TechLibrary
registerElectrics
in interface TechLibrary
E
- 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)
TechLibrary
registerElectrics
in interface TechLibrary
E
- 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)
TechLibrary
getMakeRegisteredElectronics
in interface TechLibrary
key
- the key to return electronics forpublic java.util.List<java.lang.String> getMakeRegisteredKeys()
TechLibrary
getMakeRegisteredKeys
in interface TechLibrary
public boolean okMessage(java.lang.String oldKey, Technical.TechCommand command, Environmental myHost, CMMsg msg)
TechLibrary
okMessage
in interface TechLibrary
oldKey
- 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)
TechLibrary
executeMsg
in interface TechLibrary
oldKey
- 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)
TechLibrary
unregisterElectronics
in interface TechLibrary
E
- the electronic component to unregisteroldKey
- the last key registered to this devicepublic void unregisterAllElectronics(java.lang.String oldKey)
TechLibrary
unregisterAllElectronics
in interface TechLibrary
oldKey
- the last key registered to this devicepublic TickClient getServiceClient()
CMLibrary
getServiceClient
in interface CMLibrary
getServiceClient
in class StdLibrary
TickClient
public java.util.Iterator<Computer> getComputers(java.lang.String key)
TechLibrary
getComputers
in interface TechLibrary
key
- the circuit keypublic java.util.Iterator<Room> getComputerRooms(java.lang.String key)
TechLibrary
getComputerRooms
in interface TechLibrary
key
- the circuit keyprotected CMMsg getPowerMsg(int powerAmt)
public boolean activate()
CMLibrary
activate
in interface CMLibrary
activate
in class StdLibrary
CMLibrary.shutdown()
public boolean tick(Tickable ticking, int tickID)
Tickable
tick
in interface Tickable
tick
in class StdLibrary
ticking
- a reference to this Tickable objecttickID
- the TICKID_ constant describing this periodic call, as defined in TickableTickable
,
ServiceEngine
,
TickableGroup
public boolean shutdown()
CMLibrary
shutdown
in interface CMLibrary
shutdown
in class StdLibrary
CMLibrary.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 TechLibrary
key
- the current keyprotected void runElectricCurrent(java.lang.String key)
public boolean seekBatteryPower(ElecPanel E, java.lang.String key)
TechLibrary
seekBatteryPower
in interface TechLibrary
E
- the key device to seek powerkey
- this devices keyprotected void runElectricCurrents()
public Manufacturer getDefaultManufacturer()
TechLibrary
getDefaultManufacturer
in interface TechLibrary
public void addManufacturer(Manufacturer manufacturer)
TechLibrary
addManufacturer
in interface TechLibrary
manufacturer
- the one to addpublic void delManufacturer(Manufacturer manufacturer)
TechLibrary
delManufacturer
in interface TechLibrary
manufacturer
- the one to removepublic void updateManufacturer(Manufacturer manufacturer)
TechLibrary
updateManufacturer
in interface TechLibrary
manufacturer
- the one to updatepublic Manufacturer getManufacturer(java.lang.String name)
TechLibrary
getManufacturer
in interface TechLibrary
name
- the manufacturer to fetchpublic Manufacturer getManufacturerOf(Technical E, java.lang.String name)
TechLibrary
getManufacturerOf
in interface TechLibrary
E
- for random manufacturers, the item to checkname
- the manufacturer to fetchpublic java.util.Iterator<Manufacturer> manufacterers()
TechLibrary
manufacterers
in interface TechLibrary
protected java.lang.String getManufacturersFilename()
protected void saveAllManufacturers()
protected void loadAllManufacturers()