com.planet_ink.coffee_mud.Common
Class DefaultManufacturer

java.lang.Object
  extended by com.planet_ink.coffee_mud.Common.DefaultManufacturer
All Implemented Interfaces:
CMCommon, Manufacturer, CMObject, java.lang.Cloneable, java.lang.Comparable<CMObject>

public class DefaultManufacturer
extends java.lang.Object
implements Manufacturer


Field Summary
protected  MaskingLibrary.CompiledZMask compiledItemMask
           
protected  double efficiency
           
protected  byte maxTechLevelDiff
           
protected  byte minTechLevelDiff
           
protected  java.lang.String name
           
protected  java.lang.String rawItemMask
           
protected  double reliability
           
protected  java.util.Set<Technical.TechType> types
           
 
Constructor Summary
DefaultManufacturer()
           
 
Method Summary
 int compareTo(CMObject o)
           
 CMObject copyOf()
          Similar to Cloneable.clone(), but does its best to make sure that any internal objects to this class are also copyOfed.
 double getEfficiencyPct()
          Returns a pct, from 0-2, to multiply by the power requirements of electronic items for certain purposes.
 MaskingLibrary.CompiledZMask getItemMask()
          Returns the item mask that describes what kind of items this manufacturer makes.
 java.lang.String getItemMaskStr()
          Returns the item mask that describes what kind of items this manufacturer makes.
 java.lang.String getManufactureredTypesList()
          Returns a comma-delimited list of the types of things this manufacturer will make.
 byte getMaxTechLevelDiff()
          Returns a positive difference from Max Tech Level-10.
 byte getMinTechLevelDiff()
          Returns a positive difference from Max Tech Level-10.
 double getReliabilityPct()
          Returns a pct, from 0-2, to multiply by the amt of damage taken, and the chance of failure, esp.
 java.lang.String getXml()
          Returns an Xml document representing this manufacturer.
 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 isManufactureredType(Technical T)
          Returns whether the given item will be manufacturered by this manufacturer.
 java.lang.String name()
          The displayable name of this object.
 CMObject newInstance()
          Returns a new instance of this class.
 void setEfficiencyPct(double pct)
          Sets a pct, from 0-2, to multiply by the power requirements of electronic items for certain purposes.
 void setItemMask(java.lang.String newMask)
          Sets the item mask that describes what kind of items this manufacturer makes.
 void setManufactureredTypesList(java.lang.String list)
          Sets the comma-delimited list of the types of things this manufacturer will make.
 void setMaxTechLevelDiff(byte max)
          Sets a positive difference from Max Tech Level-10.
 void setMinTechLevelDiff(byte min)
          Sets a positive difference from Max Tech Level-10.
 void setName(java.lang.String name)
          Sets the name of the manufacturer
 void setReliabilityPct(double pct)
          Sets a pct, from 0-2, to multiply by the amt of damage taken, and the chance of failure, esp.
 void setXml(java.lang.String xml)
          Sets an Xml document representing this manufacturer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected java.lang.String name

maxTechLevelDiff

protected byte maxTechLevelDiff

minTechLevelDiff

protected byte minTechLevelDiff

efficiency

protected double efficiency

reliability

protected double reliability

rawItemMask

protected java.lang.String rawItemMask

types

protected java.util.Set<Technical.TechType> types

compiledItemMask

protected MaskingLibrary.CompiledZMask compiledItemMask
Constructor Detail

DefaultManufacturer

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

name

public java.lang.String name()
Description copied from interface: CMObject
The displayable name of this object. May be modified by phyStats() object. Is derived from the Name().

Specified by:
name in interface CMObject
Returns:
the modified final name of this object on the map.
See Also:
Environmental.Name()

newInstance

public CMObject newInstance()
Description copied from interface: CMObject
Returns a new instance of this class.

Specified by:
newInstance in interface CMObject
Returns:
a new instance of this class

initializeClass

public void initializeClass()
Description copied from interface: CMObject
Called ONCE after all objects are loaded, but before the map is read in during initialization.

Specified by:
initializeClass in interface CMObject

compareTo

public int compareTo(CMObject o)
Specified by:
compareTo in interface java.lang.Comparable<CMObject>

copyOf

public CMObject copyOf()
Description copied from interface: CMObject
Similar to Cloneable.clone(), but does its best to make sure that any internal objects to this class are also copyOfed.

Specified by:
copyOf in interface CMObject
Returns:
a clone of this object

getMaxTechLevelDiff

public byte getMaxTechLevelDiff()
Description copied from interface: Manufacturer
Returns a positive difference from Max Tech Level-10. This is the maximum tech level this manufacturer can manage.

Specified by:
getMaxTechLevelDiff in interface Manufacturer
Returns:
a number from 0-10

setMaxTechLevelDiff

public void setMaxTechLevelDiff(byte max)
Description copied from interface: Manufacturer
Sets a positive difference from Max Tech Level-10. This is the maximum tech level this manufacturer can manage.

Specified by:
setMaxTechLevelDiff in interface Manufacturer
Parameters:
max - a number from 0-10

getMinTechLevelDiff

public byte getMinTechLevelDiff()
Description copied from interface: Manufacturer
Returns a positive difference from Max Tech Level-10. This is the minimum tech level this manufacturer can manage.

Specified by:
getMinTechLevelDiff in interface Manufacturer
Returns:
a number from 0-10

setMinTechLevelDiff

public void setMinTechLevelDiff(byte min)
Description copied from interface: Manufacturer
Sets a positive difference from Max Tech Level-10. This is the minimum tech level this manufacturer will make.

Specified by:
setMinTechLevelDiff in interface Manufacturer
Parameters:
min - a number from 0-10

setName

public void setName(java.lang.String name)
Description copied from interface: Manufacturer
Sets the name of the manufacturer

Specified by:
setName in interface Manufacturer
Parameters:
name - of the manufacturer

getEfficiencyPct

public double getEfficiencyPct()
Description copied from interface: Manufacturer
Returns a pct, from 0-2, to multiply by the power requirements of electronic items for certain purposes. A 1.0 means perfectly standard. A 2.0 means very inefficient. A 0.5 means super efficient.

Specified by:
getEfficiencyPct in interface Manufacturer
Returns:
a pct, from 0-2

setEfficiencyPct

public void setEfficiencyPct(double pct)
Description copied from interface: Manufacturer
Sets a pct, from 0-2, to multiply by the power requirements of electronic items for certain purposes. A 1.0 means perfectly standard. A 2.0 means very inefficient. A 0.5 means super efficient.

Specified by:
setEfficiencyPct in interface Manufacturer
Parameters:
pct - from 0-2

getReliabilityPct

public double getReliabilityPct()
Description copied from interface: Manufacturer
Returns a pct, from 0-2, to multiply by the amt of damage taken, and the chance of failure, esp. when damaged. A 1.0 means perfectly standard. A 2.0 means super-standard. A 0.5 means sub standard.

Specified by:
getReliabilityPct in interface Manufacturer
Returns:
a pct, from 0-2

setReliabilityPct

public void setReliabilityPct(double pct)
Description copied from interface: Manufacturer
Sets a pct, from 0-2, to multiply by the amt of damage taken, and the chance of failure, esp. when damaged. A 1.0 means perfectly standard. A 2.0 means super-standard. A 0.5 means sub standard.

Specified by:
setReliabilityPct in interface Manufacturer
Parameters:
pct - from 0-2

getItemMaskStr

public java.lang.String getItemMaskStr()
Description copied from interface: Manufacturer
Returns the item mask that describes what kind of items this manufacturer makes.

Specified by:
getItemMaskStr in interface Manufacturer
Returns:
the zapperMask, not compiled
See Also:
MaskingLibrary

setItemMask

public void setItemMask(java.lang.String newMask)
Description copied from interface: Manufacturer
Sets the item mask that describes what kind of items this manufacturer makes.

Specified by:
setItemMask in interface Manufacturer
Parameters:
newMask - the zapperMask
See Also:
MaskingLibrary

isManufactureredType

public boolean isManufactureredType(Technical T)
Description copied from interface: Manufacturer
Returns whether the given item will be manufacturered by this manufacturer.

Specified by:
isManufactureredType in interface Manufacturer
Parameters:
T - the item type
Returns:
true if this manufacturer will do it

getManufactureredTypesList

public java.lang.String getManufactureredTypesList()
Description copied from interface: Manufacturer
Returns a comma-delimited list of the types of things this manufacturer will make.

Specified by:
getManufactureredTypesList in interface Manufacturer
Returns:
a comma-delimited list of the types of things this manufacturer will make.

setManufactureredTypesList

public void setManufactureredTypesList(java.lang.String list)
Description copied from interface: Manufacturer
Sets the comma-delimited list of the types of things this manufacturer will make.

Specified by:
setManufactureredTypesList in interface Manufacturer
Parameters:
list - the comma-delimited list of the types of things this manufacturer will make.

getItemMask

public MaskingLibrary.CompiledZMask getItemMask()
Description copied from interface: Manufacturer
Returns the item mask that describes what kind of items this manufacturer makes.

Specified by:
getItemMask in interface Manufacturer
Returns:
the zapperMask, compiled
See Also:
MaskingLibrary

getXml

public java.lang.String getXml()
Description copied from interface: Manufacturer
Returns an Xml document representing this manufacturer.

Specified by:
getXml in interface Manufacturer
Returns:
an Xml document representing this manufacturer.

setXml

public void setXml(java.lang.String xml)
Description copied from interface: Manufacturer
Sets an Xml document representing this manufacturer. This will "build out" the manufacturer object.

Specified by:
setXml in interface Manufacturer
Parameters:
xml - Xml document representing this manufacturer.