|
|||||||||
| 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.CMCatalog
public class CMCatalog
| Nested Class Summary | |
|---|---|
protected static class |
CMCatalog.CataDataImpl
|
protected static class |
CMCatalog.RoomContentImpl
|
| Nested classes/interfaces inherited from interface com.planet_ink.coffee_mud.Libraries.interfaces.CatalogLibrary |
|---|
CatalogLibrary.CataData, CatalogLibrary.CatalogKind, CatalogLibrary.RoomContent |
| Field Summary | |
|---|---|
CMFile.CMVFSDir |
catalogFileItemsRoot
|
CMFile.CMVFSDir |
catalogFileMobsRoot
|
DVector |
icatalog
|
DVector |
mcatalog
|
| Fields inherited from class com.planet_ink.coffee_mud.Libraries.StdLibrary |
|---|
isDebugging, name, serviceClient, tickStatus |
| Constructor Summary | |
|---|---|
CMCatalog()
|
|
| Method Summary | |
|---|---|
boolean |
activate()
Activates the library. |
void |
addCatalog(Physical PA)
Creates a new catalog item or mob from the given item or mob in no catagory. |
void |
addCatalog(java.lang.String category,
Physical PA)
Creates a new catalog item or mob from the given item or mob in the given catagory. |
protected void |
addCatalogReplace(DVector DV,
java.lang.String category,
Physical P)
|
void |
bumpDeathPickup(Physical P)
When a cataloged mob dies, or a cataloged item is picked up, this method is called to bump the metadata stats on the object. |
void |
changeCatalogFlag(Physical P,
boolean truefalse)
|
void |
changeCatalogUsage(Physical P,
boolean toCataloged)
Adds or clears the catalog flag on the item or mob instance given to this method, and adds (or removes) it as an instance from the catadata for its prototype. |
java.lang.StringBuffer |
checkCatalogIntegrity(Physical P)
Given an item or mob that might be in the catalog, this method confirms that fact. |
void |
delCatalog(Physical P)
Completely removes the given item or mob from the catalog, deleting it from the database, and unsetting the cataloged flag from every instance in the world, though it does not save the items.. |
protected void |
forceTick()
|
CatalogLibrary.CataData |
getCatalogData(Physical P)
Returns the cataloged metadata for the mob or item of the same type and with the same name as the given object. |
Item |
getCatalogItem(java.lang.String called)
Returns the cataloged prototype item of the given name. |
CatalogLibrary.CataData |
getCatalogItemData(java.lang.String called)
Returns the cataloged metadata for the item of the given name |
java.lang.String[] |
getCatalogItemNames()
Creates a list of all the item keys (names) of all the items in the catalog, regardless of catagory. |
java.lang.String[] |
getCatalogItemNames(java.lang.String cataName)
Creates a list of all the item keys (names) of all the items in the catalog in the given catagory. |
Item[] |
getCatalogItems()
Creates a list of all the prototype catalog items. |
protected CMFile.CMVFSDir |
getCatalogItemsRoot(CMFile.CMVFSDir rootRoot)
|
MOB |
getCatalogMob(java.lang.String called)
Returns the cataloged prototype mob of the given name. |
CatalogLibrary.CataData |
getCatalogMobData(java.lang.String called)
Returns the cataloged metadata for the mob of the given name |
java.lang.String[] |
getCatalogMobNames()
Creates a list of all the mob keys (names) of all the mobs in the catalog, regardless of catagory. |
java.lang.String[] |
getCatalogMobNames(java.lang.String cataName)
Creates a list of all the mob keys (names) of all the mobs in the catalog in the given catagory. |
MOB[] |
getCatalogMobs()
Creates a list of all the prototype catalog mobs. |
protected CMFile.CMVFSDir |
getCatalogMobsRoot(CMFile.CMVFSDir rootRoot)
|
Physical |
getCatalogObj(Physical P)
Returns the cataloged prototype mob or item of the same type and with the same name as the given object. |
protected java.lang.Object |
getCatalogObject(DVector list,
java.lang.String name,
int dim)
|
CMFile.CMVFSDir |
getCatalogRoot(CMFile.CMVFSDir root)
In order to make the catalog appear in the vfs directory paths, this method is called to get the root directory of the catalog, which automatically turns all the catalog entries into directories and files. |
protected CMFile.CMVFSDir |
getCatalogRoot(DVector catalog,
java.lang.String rootName,
CMFile.CMVFSDir rootRoot)
|
Item |
getDropItem(MOB M,
boolean live)
The catalog has the ability to provide random items from the catalog as either random equipment on a live mob, or a random drop from a dead one. |
java.lang.String[] |
getItemCatalogCatagories()
Creates a list of all the catagories that items have been placed in. |
java.lang.String[] |
getMobCatalogCatagories()
Creates a list of all the catagories that mobs have been placed in. |
java.lang.String |
ID()
The CoffeeMud Java Class ID shared by all instances of this object. |
boolean |
isCatalogObj(Environmental E)
Returns whether there exists an item/mob in the catalog of the same type and name/key as the given item or mob. |
boolean |
isCatalogObj(java.lang.String name)
Returns whether there exists an item or mob in the catalog of the given name/key. |
java.lang.String[] |
makeCatalogCatagories(DVector catalog)
|
java.lang.String[] |
makeCatalogNames(java.lang.String catName,
DVector catalog)
|
void |
newInstance(Physical P)
Registers the given cataloged item or mob as being an instance, for metadata collection purposes only. |
protected void |
propogateShopChange(ShopKeeper SK,
java.util.Set<Physical> ignored,
Physical cataP)
|
java.util.Vector<CatalogLibrary.RoomContent> |
roomContent(Room R)
Returns the coded contents of a room, as it presently exists. |
CatalogLibrary.CataData |
sampleCataData(java.lang.String xml)
Builds catalog metadata, optionally building it from an xml doc of saved metadata. |
void |
setCategory(Physical P,
java.lang.String category)
Changes the catagory of the catalog item with the given physical objects name to the given catagory. |
boolean |
shutdown()
Shuts down the library. |
void |
submitToCatalog(Physical P)
If the given item or mob is not yet in the catalog prototype library, this method will mark it as uncataloged (as is correct for a prototype), and add it to the items or mobs list, depending on which is appropriate. |
void |
submitToCatalog(java.lang.String category,
Physical P)
|
boolean |
tick(Tickable ticking,
int tickID)
this is the method which is called periodically by the threading engine. |
void |
updateCatalog(Physical modelP)
When the properties of a cataloged item or mob change, this method is called to propagate those changes into the catalog prototype, and then to all the known instances of the cataloged item. |
void |
updateCatalogCategory(Physical modelP,
java.lang.String newCat)
Updates the catagory assigned to the given prototype mob or item to the given catagory. |
void |
updateCatalogIntegrity(Physical P)
Confirms this mob or item instance against the catalog prototype. |
void |
updateRoomContent(java.lang.String roomID,
java.util.List<CatalogLibrary.RoomContent> content)
Updates the database entries of the given room id and the adjusted content objects. |
| Methods inherited from class com.planet_ink.coffee_mud.Libraries.StdLibrary |
|---|
checkDatabase, compareTo, copyOf, getServiceClient, getTickStatus, initializeClass, 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 |
|---|
getServiceClient, L, propertiesLoaded |
| Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.CMObject |
|---|
copyOf, initializeClass, name, newInstance |
| Methods inherited from interface java.lang.Comparable |
|---|
compareTo |
| Field Detail |
|---|
public DVector icatalog
public DVector mcatalog
public volatile CMFile.CMVFSDir catalogFileMobsRoot
public volatile CMFile.CMVFSDir catalogFileItemsRoot
| Constructor Detail |
|---|
public CMCatalog()
| Method Detail |
|---|
public java.lang.String ID()
CMObject
ID in interface CMObjectID in class StdLibrary
public void changeCatalogFlag(Physical P,
boolean truefalse)
protected java.lang.Object getCatalogObject(DVector list,
java.lang.String name,
int dim)
protected void addCatalogReplace(DVector DV,
java.lang.String category,
Physical P)
public java.lang.String[] makeCatalogNames(java.lang.String catName,
DVector catalog)
public java.lang.String[] makeCatalogCatagories(DVector catalog)
public java.lang.String[] getCatalogItemNames()
CatalogLibrary
getCatalogItemNames in interface CatalogLibraryCatalogLibrary.getCatalogItemNames(String)public java.lang.String[] getCatalogItemNames(java.lang.String cataName)
CatalogLibrary
getCatalogItemNames in interface CatalogLibrarycataName - the item catagory to filter by
CatalogLibrary.getCatalogItemNames()public java.lang.String[] getCatalogMobNames()
CatalogLibrary
getCatalogMobNames in interface CatalogLibraryCatalogLibrary.getCatalogItemNames(),
CatalogLibrary.getCatalogMobNames(String)public java.lang.String[] getCatalogMobNames(java.lang.String cataName)
CatalogLibrary
getCatalogMobNames in interface CatalogLibrarycataName - the mob catagory to filter by
CatalogLibrary.getCatalogMobNames()public java.lang.String[] getMobCatalogCatagories()
CatalogLibrary
getMobCatalogCatagories in interface CatalogLibraryCatalogLibrary.getItemCatalogCatagories()public java.lang.String[] getItemCatalogCatagories()
CatalogLibrary
getItemCatalogCatagories in interface CatalogLibraryCatalogLibrary.getMobCatalogCatagories()public Item[] getCatalogItems()
CatalogLibrary
getCatalogItems in interface CatalogLibraryCatalogLibrary.getCatalogMobs()public MOB[] getCatalogMobs()
CatalogLibrary
getCatalogMobs in interface CatalogLibraryCatalogLibrary.getCatalogItems()public boolean isCatalogObj(Environmental E)
CatalogLibrary
isCatalogObj in interface CatalogLibraryE - the item or mob
CatalogLibrary.isCatalogObj(String)public boolean isCatalogObj(java.lang.String name)
CatalogLibrary
isCatalogObj in interface CatalogLibraryname - the item or mob name
CatalogLibrary.isCatalogObj(Environmental)public Item getCatalogItem(java.lang.String called)
CatalogLibrary
getCatalogItem in interface CatalogLibrarycalled - the name to look for.
CatalogLibrary.getCatalogItem(String),
CatalogLibrary.getCatalogObj(Physical)public MOB getCatalogMob(java.lang.String called)
CatalogLibrary
getCatalogMob in interface CatalogLibrarycalled - the name to look for.
CatalogLibrary.getCatalogMob(String),
CatalogLibrary.getCatalogObj(Physical)public CatalogLibrary.CataData getCatalogItemData(java.lang.String called)
CatalogLibrary
getCatalogItemData in interface CatalogLibrarycalled - the name of the cataloged item.
CatalogLibrary.CataData,
CatalogLibrary.getCatalogMobData(String),
CatalogLibrary.getCatalogData(Physical)public CatalogLibrary.CataData getCatalogMobData(java.lang.String called)
CatalogLibrary
getCatalogMobData in interface CatalogLibrarycalled - the name of the cataloged mob.
CatalogLibrary.CataData,
CatalogLibrary.getCatalogItemData(String),
CatalogLibrary.getCatalogData(Physical)public java.util.Vector<CatalogLibrary.RoomContent> roomContent(Room R)
CatalogLibrary
roomContent in interface CatalogLibraryR - the room to retrieve content from
CatalogLibrary.updateRoomContent(String, List),
CatalogLibrary.RoomContent
public void updateRoomContent(java.lang.String roomID,
java.util.List<CatalogLibrary.RoomContent> content)
CatalogLibrary
updateRoomContent in interface CatalogLibraryroomID - the roomID of the room being updatedcontent - the adjusted content of the roomCatalogLibrary.roomContent(Room),
CatalogLibrary.RoomContentpublic void addCatalog(Physical PA)
CatalogLibrary
addCatalog in interface CatalogLibraryPA - the item or mob to create in the catalogCatalogLibrary.addCatalog(String, Physical),
CatalogLibrary.delCatalog(Physical),
CatalogLibrary.submitToCatalog(Physical),
CatalogLibrary.updateCatalog(Physical)
public void addCatalog(java.lang.String category,
Physical PA)
CatalogLibrary
addCatalog in interface CatalogLibrarycategory - the new catagory, such as nullPA - the item or mob to create in the catalogCatalogLibrary.addCatalog(Physical),
CatalogLibrary.delCatalog(Physical),
CatalogLibrary.submitToCatalog(Physical)public void submitToCatalog(Physical P)
CatalogLibrary
submitToCatalog in interface CatalogLibraryP - the item or mob to add to the catalogCatalogLibrary.addCatalog(Physical),
CatalogLibrary.delCatalog(Physical),
CatalogLibrary.addCatalog(String, Physical)
public void submitToCatalog(java.lang.String category,
Physical P)
public void delCatalog(Physical P)
CatalogLibrary
delCatalog in interface CatalogLibraryP - the item or mob whose name and prototype are removedCatalogLibrary.addCatalog(Physical),
CatalogLibrary.updateCatalog(Physical)
public void updateCatalogCategory(Physical modelP,
java.lang.String newCat)
CatalogLibrary
updateCatalogCategory in interface CatalogLibrarymodelP - the prototype mob or itemnewCat - the catagory to change it into, or nullCatalogLibrary.setCategory(Physical, String)public void updateCatalog(Physical modelP)
CatalogLibrary
updateCatalog in interface CatalogLibrarymodelP - the updated changed item or mobpublic void newInstance(Physical P)
CatalogLibrary
newInstance in interface CatalogLibraryP - the item or mob to register as being in the worldpublic void bumpDeathPickup(Physical P)
CatalogLibrary
bumpDeathPickup in interface CatalogLibraryP - the item or mob to bump the stats on
public void changeCatalogUsage(Physical P,
boolean toCataloged)
CatalogLibrary
changeCatalogUsage in interface CatalogLibraryP - the item or mob to altertoCataloged - true to flag it as cataloged, false to clear its flag.
protected void propogateShopChange(ShopKeeper SK,
java.util.Set<Physical> ignored,
Physical cataP)
public CatalogLibrary.CataData getCatalogData(Physical P)
CatalogLibrary
getCatalogData in interface CatalogLibraryP - the object type and name to look for
CatalogLibrary.CataData,
CatalogLibrary.getCatalogItemData(String),
CatalogLibrary.getCatalogMobData(String)public Physical getCatalogObj(Physical P)
CatalogLibrary
getCatalogObj in interface CatalogLibraryP - the object type and name to look for
CatalogLibrary.getCatalogMob(String),
CatalogLibrary.getCatalogItem(String)
public void setCategory(Physical P,
java.lang.String category)
CatalogLibrary
setCategory in interface CatalogLibraryP - the catalog item to get a key/name fromcategory - the new catagory, such as nullCatalogLibrary.updateCatalogCategory(Physical, String)public void updateCatalogIntegrity(Physical P)
CatalogLibrary
updateCatalogIntegrity in interface CatalogLibraryP - the item or mob to confirm against the catalog prototypepublic java.lang.StringBuffer checkCatalogIntegrity(Physical P)
CatalogLibrary
checkCatalogIntegrity in interface CatalogLibraryP - the item or mob to check
public Item getDropItem(MOB M,
boolean live)
CatalogLibrary
getDropItem in interface CatalogLibraryM - the mob to equiplive - true if its for a live mob, false if its for a corpse
public CatalogLibrary.CataData sampleCataData(java.lang.String xml)
CatalogLibrary
sampleCataData in interface CatalogLibraryxml - an optional xml doc of metadata data
CatalogLibrary.CataDatapublic boolean activate()
CMLibrary
activate in interface CMLibraryactivate in class StdLibraryCMLibrary.shutdown()
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 forceTick()
protected CMFile.CMVFSDir getCatalogMobsRoot(CMFile.CMVFSDir rootRoot)
protected CMFile.CMVFSDir getCatalogItemsRoot(CMFile.CMVFSDir rootRoot)
public CMFile.CMVFSDir getCatalogRoot(CMFile.CMVFSDir root)
CatalogLibrary
getCatalogRoot in interface CatalogLibraryroot - the vfs dir of the resources directory
protected CMFile.CMVFSDir getCatalogRoot(DVector catalog,
java.lang.String rootName,
CMFile.CMVFSDir rootRoot)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||