CMObject, Tickable, CatalogLibrary, CMLibrary, java.lang.Cloneable, java.lang.Comparable<CMObject>public class CMCatalog extends StdLibrary implements CatalogLibrary
| Modifier and Type | Class | Description |
|---|---|---|
protected static class |
CMCatalog.CataDataImpl |
|
protected static class |
CMCatalog.RoomContentImpl |
CatalogLibrary.CataData, CatalogLibrary.CatalogKind, CatalogLibrary.CataSpawn, CatalogLibrary.RoomContent| Modifier and Type | Field | Description |
|---|---|---|
CMFile.CMVFSDir |
catalogFileItemsRoot |
|
CMFile.CMVFSDir |
catalogFileMobsRoot |
|
protected java.lang.String |
commonBuilderTemplateKey |
|
DVector |
icatalog |
|
DVector |
mcatalog |
|
protected java.lang.String |
templatePersonalSection |
|
protected java.lang.String |
templateSharedSection |
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 |
|---|---|
CMCatalog() |
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
activate() |
Activates the library.
|
java.lang.String |
addCataDataFromXML(java.lang.String xmlBuffer,
java.util.List<CatalogLibrary.CataData> addHere,
java.util.List<? extends Physical> nameMatchers,
Session S) |
Populate a given CataData list with data objects contained in the given
xml document.
|
void |
addCatalog(Physical PA) |
Creates a new catalog item or mob from the given item or mob
in no category.
|
void |
addCatalog(java.lang.String category,
Physical PA) |
Creates a new catalog item or mob from the given item or mob
in the given category.
|
protected void |
addCatalogReplace(DVector DV,
java.lang.String category,
Physical P) |
|
boolean |
addNewBuilderTemplateObject(java.lang.String playerName,
java.lang.String ID,
Environmental E) |
This is for the non-catalog Builder Templates system.
|
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..
|
boolean |
deleteBuilderTemplateObject(java.lang.String playerName,
java.lang.String ID) |
This is for the non-catalog Builder Templates system.
|
protected void |
forceTick() |
|
java.util.List<Triad<java.lang.String,java.lang.String,java.lang.String>> |
getBuilderTemplateList(java.lang.String playerName) |
This is for the non-catalog Builder Templates system.
|
Environmental |
getBuilderTemplateObject(java.lang.String playerName,
java.lang.String ID) |
This is for the non-catalog Builder Templates system.
|
java.util.Map<java.lang.String,DatabaseEngine.PlayerData> |
getBuilderTemplates(java.lang.String playerName,
boolean extend) |
|
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 category.
|
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 category.
|
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 category.
|
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 category.
|
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 categories that items have been
placed in.
|
java.lang.String[] |
getMobCatalogCatagories() |
Creates a list of all the categories that mobs have been
placed in.
|
protected Room |
getSpawnRoom(CatalogLibrary.CataData data,
java.util.List<Room> choiceCache,
java.util.Map<java.lang.String,java.util.List<Room>> cacheSets) |
|
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) |
|
java.lang.String |
makeValidNewBuilderTemplateID(java.lang.String ID) |
This is for the non-catalog Builder Templates system.
|
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 category of the catalog item with the given
physical objects name to the given category.
|
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.
|
boolean |
toggleBuilderTemplateObject(java.lang.String playerName,
java.lang.String ID) |
This is for the non-catalog Builder Templates system.
|
protected java.lang.String |
unpackErr(java.lang.String where,
java.lang.String msg) |
|
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 category assigned to the given prototype mob or
item to the given category.
|
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.
|
getServiceClient, L, propertiesLoadedcopyOf, initializeClass, name, newInstanceclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcheckDatabase, compareTo, copyOf, getServiceClient, getTickStatus, initializeClass, L, name, newInstance, propertiesLoaded, setThreadStatusprotected java.lang.String commonBuilderTemplateKey
protected java.lang.String templatePersonalSection
protected java.lang.String templateSharedSection
public DVector icatalog
public DVector mcatalog
public volatile CMFile.CMVFSDir catalogFileMobsRoot
public volatile CMFile.CMVFSDir catalogFileItemsRoot
public java.lang.String ID()
CMObjectID in interface CMObjectID in class StdLibrarypublic 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()
CatalogLibrarygetCatalogItemNames in interface CatalogLibraryCatalogLibrary.getCatalogItemNames(String)public java.lang.String[] getCatalogItemNames(java.lang.String cataName)
CatalogLibrarygetCatalogItemNames in interface CatalogLibrarycataName - the item category to filter byCatalogLibrary.getCatalogItemNames()public java.lang.String[] getCatalogMobNames()
CatalogLibrarygetCatalogMobNames in interface CatalogLibraryCatalogLibrary.getCatalogItemNames(),
CatalogLibrary.getCatalogMobNames(String)public java.lang.String[] getCatalogMobNames(java.lang.String cataName)
CatalogLibrarygetCatalogMobNames in interface CatalogLibrarycataName - the mob category to filter byCatalogLibrary.getCatalogMobNames()public java.lang.String[] getMobCatalogCatagories()
CatalogLibrarygetMobCatalogCatagories in interface CatalogLibraryCatalogLibrary.getItemCatalogCatagories()public java.lang.String[] getItemCatalogCatagories()
CatalogLibrarygetItemCatalogCatagories in interface CatalogLibraryCatalogLibrary.getMobCatalogCatagories()public Item[] getCatalogItems()
CatalogLibrarygetCatalogItems in interface CatalogLibraryCatalogLibrary.getCatalogMobs()public MOB[] getCatalogMobs()
CatalogLibrarygetCatalogMobs in interface CatalogLibraryCatalogLibrary.getCatalogItems()public boolean isCatalogObj(Environmental E)
CatalogLibraryisCatalogObj in interface CatalogLibraryE - the item or mobCatalogLibrary.isCatalogObj(String)public boolean isCatalogObj(java.lang.String name)
CatalogLibraryisCatalogObj in interface CatalogLibraryname - the item or mob nameCatalogLibrary.isCatalogObj(Environmental)public Item getCatalogItem(java.lang.String called)
CatalogLibrarygetCatalogItem in interface CatalogLibrarycalled - the name to look for.CatalogLibrary.getCatalogItem(String),
CatalogLibrary.getCatalogObj(Physical)public MOB getCatalogMob(java.lang.String called)
CatalogLibrarygetCatalogMob in interface CatalogLibrarycalled - the name to look for.CatalogLibrary.getCatalogMob(String),
CatalogLibrary.getCatalogObj(Physical)public CatalogLibrary.CataData getCatalogItemData(java.lang.String called)
CatalogLibrarygetCatalogItemData 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)
CatalogLibrarygetCatalogMobData 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)
CatalogLibraryroomContent in interface CatalogLibraryR - the room to retrieve content fromCatalogLibrary.updateRoomContent(String, List),
CatalogLibrary.RoomContentpublic void updateRoomContent(java.lang.String roomID,
java.util.List<CatalogLibrary.RoomContent> content)
CatalogLibraryupdateRoomContent in interface CatalogLibraryroomID - the roomID of the room being updatedcontent - the adjusted content of the roomCatalogLibrary.roomContent(Room),
CatalogLibrary.RoomContentpublic void addCatalog(Physical PA)
CatalogLibraryaddCatalog 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)
CatalogLibraryaddCatalog in interface CatalogLibrarycategory - the new category, 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)
CatalogLibrarysubmitToCatalog 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)
CatalogLibrarydelCatalog 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)
CatalogLibraryupdateCatalogCategory in interface CatalogLibrarymodelP - the prototype mob or itemnewCat - the category to change it into, or nullCatalogLibrary.setCategory(Physical, String)public void updateCatalog(Physical modelP)
CatalogLibraryupdateCatalog in interface CatalogLibrarymodelP - the updated changed item or mobpublic void newInstance(Physical P)
CatalogLibrarynewInstance in interface CatalogLibraryP - the item or mob to register as being in the worldpublic void bumpDeathPickup(Physical P)
CatalogLibrarybumpDeathPickup in interface CatalogLibraryP - the item or mob to bump the stats onpublic void changeCatalogUsage(Physical P, boolean toCataloged)
CatalogLibrarychangeCatalogUsage 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)
CatalogLibrarygetCatalogData in interface CatalogLibraryP - the object type and name to look forCatalogLibrary.CataData,
CatalogLibrary.getCatalogItemData(String),
CatalogLibrary.getCatalogMobData(String)public Physical getCatalogObj(Physical P)
CatalogLibrarygetCatalogObj in interface CatalogLibraryP - the object type and name to look forCatalogLibrary.getCatalogMob(String),
CatalogLibrary.getCatalogItem(String)public void setCategory(Physical P, java.lang.String category)
CatalogLibrarysetCategory in interface CatalogLibraryP - the catalog item to get a key/name fromcategory - the new category, such as nullCatalogLibrary.updateCatalogCategory(Physical, String)public void updateCatalogIntegrity(Physical P)
CatalogLibraryupdateCatalogIntegrity in interface CatalogLibraryP - the item or mob to confirm against the catalog prototypepublic java.lang.StringBuffer checkCatalogIntegrity(Physical P)
CatalogLibrarycheckCatalogIntegrity in interface CatalogLibraryP - the item or mob to checkpublic Item getDropItem(MOB M, boolean live)
CatalogLibrarygetDropItem in interface CatalogLibraryM - the mob to equiplive - true if its for a live mob, false if its for a corpsepublic CatalogLibrary.CataData sampleCataData(java.lang.String xml)
CatalogLibrarysampleCataData in interface CatalogLibraryxml - an optional xml doc of metadata dataCatalogLibrary.CataDatapublic boolean activate()
CMLibraryactivate in interface CMLibraryactivate in class StdLibraryCMLibrary.shutdown()protected Room getSpawnRoom(CatalogLibrary.CataData data, java.util.List<Room> choiceCache, java.util.Map<java.lang.String,java.util.List<Room>> cacheSets)
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 forceTick()
protected CMFile.CMVFSDir getCatalogMobsRoot(CMFile.CMVFSDir rootRoot)
protected CMFile.CMVFSDir getCatalogItemsRoot(CMFile.CMVFSDir rootRoot)
public CMFile.CMVFSDir getCatalogRoot(CMFile.CMVFSDir root)
CatalogLibrarygetCatalogRoot in interface CatalogLibraryroot - the vfs dir of the resources directoryprotected CMFile.CMVFSDir getCatalogRoot(DVector catalog, java.lang.String rootName, CMFile.CMVFSDir rootRoot)
public java.lang.String makeValidNewBuilderTemplateID(java.lang.String ID)
CatalogLibrarymakeValidNewBuilderTemplateID in interface CatalogLibraryID - the possible new template object idCatalogLibrary.addNewBuilderTemplateObject(String, String, Environmental),
CatalogLibrary.deleteBuilderTemplateObject(String, String),
CatalogLibrary.toggleBuilderTemplateObject(String, String),
CatalogLibrary.makeValidNewBuilderTemplateID(String),
CatalogLibrary.getBuilderTemplateObject(String, String),
CatalogLibrary.getBuilderTemplateList(String)public java.util.Map<java.lang.String,DatabaseEngine.PlayerData> getBuilderTemplates(java.lang.String playerName, boolean extend)
public java.util.List<Triad<java.lang.String,java.lang.String,java.lang.String>> getBuilderTemplateList(java.lang.String playerName)
CatalogLibrarygetBuilderTemplateList in interface CatalogLibraryplayerName - the owner of the templatesCatalogLibrary.addNewBuilderTemplateObject(String, String, Environmental),
CatalogLibrary.deleteBuilderTemplateObject(String, String),
CatalogLibrary.toggleBuilderTemplateObject(String, String),
CatalogLibrary.makeValidNewBuilderTemplateID(String),
CatalogLibrary.getBuilderTemplateObject(String, String),
CatalogLibrary.getBuilderTemplateList(String)public Environmental getBuilderTemplateObject(java.lang.String playerName, java.lang.String ID)
CatalogLibrarygetBuilderTemplateObject in interface CatalogLibraryplayerName - the player to whom the template belongsID - the id code of the itemCatalogLibrary.addNewBuilderTemplateObject(String, String, Environmental),
CatalogLibrary.deleteBuilderTemplateObject(String, String),
CatalogLibrary.toggleBuilderTemplateObject(String, String),
CatalogLibrary.makeValidNewBuilderTemplateID(String),
CatalogLibrary.getBuilderTemplateObject(String, String),
CatalogLibrary.getBuilderTemplateList(String)public boolean addNewBuilderTemplateObject(java.lang.String playerName,
java.lang.String ID,
Environmental E)
CatalogLibraryaddNewBuilderTemplateObject in interface CatalogLibraryplayerName - the player to whom the template belongsID - the friendly short validated id codeE - the mob, item, room, or exit object to addCatalogLibrary.addNewBuilderTemplateObject(String, String, Environmental),
CatalogLibrary.deleteBuilderTemplateObject(String, String),
CatalogLibrary.toggleBuilderTemplateObject(String, String),
CatalogLibrary.makeValidNewBuilderTemplateID(String),
CatalogLibrary.getBuilderTemplateObject(String, String),
CatalogLibrary.getBuilderTemplateList(String)public boolean deleteBuilderTemplateObject(java.lang.String playerName,
java.lang.String ID)
CatalogLibrarydeleteBuilderTemplateObject in interface CatalogLibraryplayerName - the player who owns the templateID - the id code of the templateCatalogLibrary.addNewBuilderTemplateObject(String, String, Environmental),
CatalogLibrary.deleteBuilderTemplateObject(String, String),
CatalogLibrary.toggleBuilderTemplateObject(String, String),
CatalogLibrary.makeValidNewBuilderTemplateID(String),
CatalogLibrary.getBuilderTemplateObject(String, String),
CatalogLibrary.getBuilderTemplateList(String)public boolean toggleBuilderTemplateObject(java.lang.String playerName,
java.lang.String ID)
CatalogLibrarytoggleBuilderTemplateObject in interface CatalogLibraryplayerName - the owner of the templateID - the templates idCatalogLibrary.addNewBuilderTemplateObject(String, String, Environmental),
CatalogLibrary.deleteBuilderTemplateObject(String, String),
CatalogLibrary.toggleBuilderTemplateObject(String, String),
CatalogLibrary.makeValidNewBuilderTemplateID(String),
CatalogLibrary.getBuilderTemplateObject(String, String),
CatalogLibrary.getBuilderTemplateList(String)protected java.lang.String unpackErr(java.lang.String where,
java.lang.String msg)
public java.lang.String addCataDataFromXML(java.lang.String xmlBuffer,
java.util.List<CatalogLibrary.CataData> addHere,
java.util.List<? extends Physical> nameMatchers,
Session S)
CatalogLibraryaddCataDataFromXML in interface CatalogLibraryxmlBuffer - the catalog data xml documentaddHere - the list to add catalog data objects tonameMatchers - null, or list of objects to match the names ofS - optional session for progress, prompts, etc