CatalogLibrary.CataData
protected static class CMCatalog.CataDataImpl extends java.lang.Object implements CatalogLibrary.CataData
Modifier and Type | Field | Description |
---|---|---|
int |
cap |
|
java.lang.String |
category |
|
int |
deathPickup |
|
java.lang.String |
lmaskStr |
|
MaskingLibrary.CompiledZMask |
lmaskV |
|
boolean |
noRefs |
|
double |
rate |
|
SVector<java.lang.ref.WeakReference<Physical>> |
refs |
|
CatalogLibrary.CataSpawn |
spawn |
Modifier | Constructor | Description |
---|---|---|
|
CataDataImpl(java.lang.String catadata) |
|
protected |
CataDataImpl(java.lang.String _lmask,
double _rate,
CatalogLibrary.CataSpawn _spawn,
int cap) |
|
protected |
CataDataImpl(java.lang.String _lmask,
java.lang.String _rate,
CatalogLibrary.CataSpawn _spawn,
int cap) |
Modifier and Type | Method | Description |
---|---|---|
void |
addReference(Physical P) |
Adds the given object as a world instance of this
cataloged object
|
void |
build(java.lang.String catadata) |
Builds this metadata from an xml doc
|
void |
bumpDeathPickup() |
Bumps the number of times this mob has died,
if the cataloged object is a mob, or the number of
times this item has been picked up, if it's an item.
|
java.lang.String |
category() |
Returns the user-defined category to which this
cataloged object belongs.
|
void |
cleanHouse() |
Goes through all the world instances of this
cataloged item and removes any that are destroyed.
|
java.lang.String |
data(java.lang.String name) |
Returns this metadata as an xml doc
|
void |
delReference(Physical P) |
Removes the given item from the list of registered
world instances of this cataloged object.
|
java.util.Enumeration<Physical> |
enumeration() |
Creates and returns an enumeration of all the instances of
this cataloged item in the world.
|
int |
getCap() |
If this item or mob is a random room spawn, then this is the
maximum number that can spawn and remain live.
|
int |
getDeathsPicksups() |
Returns the number of times this mob has died,
if the cataloged object is a mob, or the number of
times this item has been picked up, if it's an item.
|
Physical |
getLiveReference() |
Returns the first world instance of this
cataloged item or mob.
|
protected RoomnumberSet |
getLocations() |
|
java.lang.String |
getMaskStr() |
A zapper mask that is applied to mobs to
determine if a particular item is potentially
a random drop.
|
MaskingLibrary.CompiledZMask |
getMaskV() |
A compiled zapper mask that is applied to mobs to
determine if a particular item is potentially
a random drop.
|
double |
getRate() |
If this item is a random drop, then this is the pct
chance that this item is a potential selection for
a random drop.
|
CatalogLibrary.CataSpawn |
getSpawn() |
If this item is a random drop or spawn, this will
describe how and when the spawn occurs.
|
boolean |
isReference(Physical P) |
Returns whether the given item is a registered world
instance of this cataloged object.
|
java.lang.String |
mostPopularArea() |
Determines and returns the name of the most
popular area in which instances of this catalog
object can be found.
|
int |
numReferences() |
Returns the number of world items that are instances
of this cataloged object.
|
java.lang.String |
randomRoom() |
Returns one of the rooms in which an instance
of this cataloged item was registered.
|
void |
setCap(int max) |
If this item or mob is a random room spawn, then this is the
maximum number that can spawn and remain live.
|
void |
setCategory(java.lang.String cat) |
Sets the user-defined category to which this
cataloged object belongs.
|
void |
setMaskStr(java.lang.String s) |
A zapper mask string that is applied to mobs to
determine if this particular item is potentially
a random drop.
|
void |
setRate(double r) |
If this item is a random drop, then this is the pct
chance that this item is a potential selection for
a random drop.
|
void |
setSpawn(CatalogLibrary.CataSpawn spawn) |
If this item is a random drop or spawn, this flag will
describe how it spawns.
|
public java.lang.String lmaskStr
public java.lang.String category
public CatalogLibrary.CataSpawn spawn
public double rate
public int cap
public volatile int deathPickup
public boolean noRefs
public MaskingLibrary.CompiledZMask lmaskV
public CataDataImpl(java.lang.String catadata)
protected CataDataImpl(java.lang.String _lmask, java.lang.String _rate, CatalogLibrary.CataSpawn _spawn, int cap)
protected CataDataImpl(java.lang.String _lmask, double _rate, CatalogLibrary.CataSpawn _spawn, int cap)
public java.lang.String category()
CatalogLibrary.CataData
category
in interface CatalogLibrary.CataData
CatalogLibrary.CataData.setCategory(String)
public void setCategory(java.lang.String cat)
CatalogLibrary.CataData
setCategory
in interface CatalogLibrary.CataData
cat
- the category nameCatalogLibrary.CataData.category()
protected RoomnumberSet getLocations()
public java.lang.String randomRoom()
CatalogLibrary.CataData
randomRoom
in interface CatalogLibrary.CataData
public java.lang.String mostPopularArea()
CatalogLibrary.CataData
mostPopularArea
in interface CatalogLibrary.CataData
public int numReferences()
CatalogLibrary.CataData
numReferences
in interface CatalogLibrary.CataData
CatalogLibrary.CataData.enumeration()
,
CatalogLibrary.CataData.addReference(Physical)
,
CatalogLibrary.CataData.isReference(Physical)
,
CatalogLibrary.CataData.delReference(Physical)
public java.util.Enumeration<Physical> enumeration()
CatalogLibrary.CataData
enumeration
in interface CatalogLibrary.CataData
CatalogLibrary.CataData.addReference(Physical)
,
CatalogLibrary.CataData.isReference(Physical)
,
CatalogLibrary.CataData.delReference(Physical)
,
CatalogLibrary.CataData.numReferences()
public int getDeathsPicksups()
CatalogLibrary.CataData
getDeathsPicksups
in interface CatalogLibrary.CataData
CatalogLibrary.CataData.bumpDeathPickup()
public void bumpDeathPickup()
CatalogLibrary.CataData
bumpDeathPickup
in interface CatalogLibrary.CataData
CatalogLibrary.CataData.bumpDeathPickup()
public void cleanHouse()
CatalogLibrary.CataData
cleanHouse
in interface CatalogLibrary.CataData
public Physical getLiveReference()
CatalogLibrary.CataData
getLiveReference
in interface CatalogLibrary.CataData
public void addReference(Physical P)
CatalogLibrary.CataData
addReference
in interface CatalogLibrary.CataData
P
- the mob or item in the worldCatalogLibrary.CataData.enumeration()
,
CatalogLibrary.CataData.isReference(Physical)
,
CatalogLibrary.CataData.delReference(Physical)
,
CatalogLibrary.CataData.numReferences()
public boolean isReference(Physical P)
CatalogLibrary.CataData
isReference
in interface CatalogLibrary.CataData
P
- the item or mob in the worldCatalogLibrary.CataData.enumeration()
,
CatalogLibrary.CataData.addReference(Physical)
,
CatalogLibrary.CataData.delReference(Physical)
,
CatalogLibrary.CataData.numReferences()
public void delReference(Physical P)
CatalogLibrary.CataData
delReference
in interface CatalogLibrary.CataData
P
- the item or mob in the worldCatalogLibrary.CataData.enumeration()
,
CatalogLibrary.CataData.addReference(Physical)
,
CatalogLibrary.CataData.isReference(Physical)
,
CatalogLibrary.CataData.numReferences()
public MaskingLibrary.CompiledZMask getMaskV()
CatalogLibrary.CataData
getMaskV
in interface CatalogLibrary.CataData
CatalogLibrary.CataData.getMaskStr()
,
CatalogLibrary.CataData.getSpawn()
,
CatalogLibrary.CataData.getRate()
public java.lang.String getMaskStr()
CatalogLibrary.CataData
getMaskStr
in interface CatalogLibrary.CataData
CatalogLibrary.CataData.getMaskV()
,
CatalogLibrary.CataData.getRate()
,
CatalogLibrary.CataData.setMaskStr(String)
public CatalogLibrary.CataSpawn getSpawn()
CatalogLibrary.CataData
getSpawn
in interface CatalogLibrary.CataData
CatalogLibrary.CataData.getMaskV()
,
CatalogLibrary.CataData.getRate()
,
CatalogLibrary.CataData.setSpawn(CataSpawn)
public double getRate()
CatalogLibrary.CataData
getRate
in interface CatalogLibrary.CataData
CatalogLibrary.CataData.getMaskV()
,
CatalogLibrary.CataData.setRate(double)
,
CatalogLibrary.CataData.getSpawn()
public void setMaskStr(java.lang.String s)
CatalogLibrary.CataData
setMaskStr
in interface CatalogLibrary.CataData
s
- a zapper mask string for dead mobsCatalogLibrary.CataData.getMaskV()
,
CatalogLibrary.CataData.getRate()
,
CatalogLibrary.CataData.getMaskStr()
public void setSpawn(CatalogLibrary.CataSpawn spawn)
CatalogLibrary.CataData
setSpawn
in interface CatalogLibrary.CataData
spawn
- The catalog spawn typeCatalogLibrary.CataData.getMaskV()
,
CatalogLibrary.CataData.getRate()
,
CatalogLibrary.CataData.getSpawn()
public void setRate(double r)
CatalogLibrary.CataData
setRate
in interface CatalogLibrary.CataData
r
- pct chance that the item is a potential selectionCatalogLibrary.CataData.getMaskV()
,
CatalogLibrary.CataData.setRate(double)
,
CatalogLibrary.CataData.getSpawn()
public java.lang.String data(java.lang.String name)
CatalogLibrary.CataData
data
in interface CatalogLibrary.CataData
name
- null, or an optional item/mob nameCatalogLibrary.CataData.build(String)
public void build(java.lang.String catadata)
CatalogLibrary.CataData
build
in interface CatalogLibrary.CataData
catadata
- this metadata as an xml docCatalogLibrary.CataData.data(String)
public void setCap(int max)
CatalogLibrary.CataData
setCap
in interface CatalogLibrary.CataData
max
- the maximum number to spawn and remain livepublic int getCap()
CatalogLibrary.CataData
getCap
in interface CatalogLibrary.CataData