RawCMaterial
public interface MaterialLibrary extends CMLibrary
Modifier and Type | Interface | Description |
---|---|---|
static interface |
MaterialLibrary.DeadResourceRecord |
A record detailing information about
destoryed resources, used mostly for common
skills that consume them.
|
idConverter
Modifier and Type | Method | Description |
---|---|---|
void |
addEffectsToResource(Item I) |
Given a raw material resource, this method will query for the
natural effects/properties of that resource type, and add
them to the given item.
|
void |
adjustResourceName(Item I) |
Given a raw material resource item with particular resource and
subType and weight/amount, this method will set its name and
display text as appropriate.
|
MaterialLibrary.DeadResourceRecord |
destroyResources(Room R,
int howMuch,
int finalMaterial,
int finalSubHash,
int otherMaterial,
int finalOtherHash) |
Searches the given room for an amount of specified qualifying resource items in the
given list and in the given container, destroys that many pounds of the resource,
and then returns all kinds of statistics about what was destroyed in the form of
a DeadResourceRecord
|
int |
destroyResourcesAmt(Room E,
int howMuch,
int resourceCode,
java.lang.String subType,
Container C) |
Searches the given room for an amount of specified qualifying resource items in the
given list and in the given container, destroys that many pounds of the resource,
and then returns the amount destroyed.
|
int |
destroyResourcesAmt(MOB E,
int howMuch,
int resourceCode,
java.lang.String subType,
Container C) |
Searches the given mob for an amount of specified qualifying resource items in the
given list and in the given container, destroys that many pounds of the resource,
and then returns the amount destroyed.
|
int |
destroyResourcesAmt(java.util.List<Item> V,
int howMuch,
int finalMaterial,
java.lang.String subType,
Container C) |
Searches the given mob for an amount of specified qualifying resource items in the
given list and in the given container, destroys that many pounds of the resource,
and then returns the amount destroyed.
|
int |
destroyResourcesValue(Room R,
int howMuch,
int finalMaterial,
int finalSubHash,
int otherMaterial,
int otherSubHash) |
Searches the given room for an amount of specified qualifying resource items in the
given list and in NO container, destroys that many pounds of the resource,
and then returns the value of what was destroyed.
|
int |
destroyResourcesValue(MOB M,
int howMuch,
int finalMaterial,
int finalSubHash,
int otherMaterial,
int otherSubHash) |
Searches the given mob for an amount of specified qualifying resource items in the
given list and in NO container, destroys that many pounds of the resource,
and then returns the value of what was destroyed.
|
int |
destroyResourcesValue(java.util.List<Item> V,
int howMuch,
int finalMaterial,
int otherMaterial,
Item never,
Container C) |
Searches the given list for an amount of specified qualifying resource items in the
given list and in the given container, destroys that many pounds of the resource,
and then returns the value of what was destroyed.
|
RawMaterial |
fetchFoundOtherEncoded(Room E,
java.lang.String otherRequired) |
Searches the given room for specified qualifying resource items.
|
RawMaterial |
fetchFoundOtherEncoded(MOB E,
java.lang.String otherRequired) |
Searches the given mob for specified qualifying resource items.
|
RawMaterial |
findFirstResource(Room E,
int resource) |
Searches the given Room for the first qualifying raw
material resource item that matches the given resource
code number.
|
RawMaterial |
findFirstResource(Room E,
java.lang.String other) |
Searches the given Room for the first qualifying raw
material resource item that matches the given resource
name, with optional subtype in parenthesis.
|
RawMaterial |
findFirstResource(MOB E,
int resource) |
Searches the given MOB for the first qualifying raw
material resource item that matches the given resource
code number.
|
RawMaterial |
findFirstResource(MOB E,
java.lang.String other) |
Searches the given MOB for the first qualifying raw
material resource item that matches the given resource
name, with optional subtype in parenthesis.
|
int |
findMaterialCode(java.lang.String s,
boolean exact) |
Searches for the given material type, and, if
found, returns the material code.
|
int |
findMaterialRelativeInt(java.lang.String s) |
Searches for the given material type, and, if
found, returns the ordinal value of the material
code.
|
RawMaterial |
findMostOfMaterial(Room E,
int material) |
Searches the given Room for the largest pile of qualifying raw
material resource item that matches the given material type
code number.
|
RawMaterial |
findMostOfMaterial(Room E,
java.lang.String other) |
Searches the given Room for the largest pile of qualifying raw
material resource item that matches the given material type
name, with optional subtype in parenthesis.
|
RawMaterial |
findMostOfMaterial(MOB E,
int material) |
Searches the given MOB for the largest pile of qualifying raw
material resource item that matches the given material type
code number.
|
RawMaterial |
findMostOfMaterial(MOB E,
java.lang.String other) |
Searches the given MOB for the largest pile of qualifying raw
material resource item that matches the given material type
name, with optional subtype in parenthesis.
|
int |
findNumberOfResourceLike(Room E,
RawMaterial resource) |
Searches the given room for all raw material resource items that
have the same material type and subtype as the given raw
material resource item, and returns the total amount of similar
resources.
|
int |
findNumberOfResourceLike(MOB E,
RawMaterial resource) |
Searches the given mob for all raw material resource items that
have the same material type and subtype as the given raw
material resource item, and returns the total amount of similar
resources.
|
int |
findResourceCode(java.lang.String s,
boolean exact) |
Searches for the given resource code by name, and, if
found, returns the resource code.
|
int |
getBurnDuration(Environmental E) |
Returns the number of ticks that the given item, whatever
will burn, or 0 if it won't burn.
|
java.lang.String |
getGeneralItemType(Item I) |
Returns a plural for the type of item given.
|
java.lang.String |
getMaterialDesc(int materialCode) |
Returns the name of the given material type code
|
int |
getRandomResourceOfMaterial(int material) |
Returns a random resource code of the given material type
|
java.lang.String |
getResourceDesc(int resourceCode) |
Returns the name of the given resource type code
|
boolean |
isResourceCodeRoomMapped(int resourceCode) |
Searches through all the locale/room classes to discover whether the given
resource code appears in any of them as a possible resource.
|
Item |
makeItemResource(int type) |
Creates a resource item of one pound.
|
Item |
makeItemResource(int type,
java.lang.String subType) |
Creates a resource item of one pound.
|
PhysicalAgent |
makeResource(int myResource,
java.lang.String localeCode,
boolean noAnimals,
java.lang.String fullName,
java.lang.String subType) |
Creates a resource item, or possibly a mob that represents the resource.
|
java.lang.String |
makeResourceBetterName(int rscCode,
java.lang.String subType,
boolean plural) |
Returns an appropriate name for an raw material item of the given
resource and subtype.
|
java.lang.String |
makeResourceSimpleName(int rscCode,
java.lang.String subType) |
Returns a simplistic name for a raw material item of the given
resource and subtype.
|
boolean |
quickDestroy(Item I) |
Removes the given item from its possessor, and then calls
destroy on the item.
|
boolean |
rebundle(Item I) |
This great workhorse takes a given raw resource item and
finds any pairings in its new possessor, and, if found,
re-bundles with the existing item, and renames it.
|
Item |
splitBundle(Item I,
int size,
Container C) |
Given a bundle (more than weight 1) raw resource item, this
method will split the item into two parts, one part of the given
size, which is returned, and the other being what remains of I.
|
Item |
unbundle(Item I,
int number,
Container C) |
Given a bundle (more than weight 1) raw resource item, this
method will split the item into the given number of parts,
each being 1 pound.
|
activate, getServiceClient, L, propertiesLoaded, shutdown
copyOf, ID, initializeClass, name, newInstance
int findMaterialRelativeInt(java.lang.String s)
s
- the possible material typefindMaterialCode(String, boolean)
,
findResourceCode(String, boolean)
int findMaterialCode(java.lang.String s, boolean exact)
s
- the possible material typeexact
- true for exact match only, false for startswithfindResourceCode(String, boolean)
,
findMaterialRelativeInt(String)
int findResourceCode(java.lang.String s, boolean exact)
s
- the possible resource codes nameexact
- true for exact match only, false for startswithfindMaterialCode(String, boolean)
,
findMaterialRelativeInt(String)
java.lang.String getResourceDesc(int resourceCode)
resourceCode
- the given resource type codegetMaterialDesc(int)
java.lang.String getMaterialDesc(int materialCode)
materialCode
- the material type codegetResourceDesc(int)
Item makeItemResource(int type)
type
- the resource codemakeItemResource(int, String)
,
makeResource(int, String, boolean, String, String)
Item makeItemResource(int type, java.lang.String subType)
type
- the resource codesubType
- "" or the subType of the resourcemakeItemResource(int)
,
makeResource(int, String, boolean, String, String)
PhysicalAgent makeResource(int myResource, java.lang.String localeCode, boolean noAnimals, java.lang.String fullName, java.lang.String subType)
myResource
- the full resource codelocaleCode
- null, the string representation of the rooms domain type sourcenoAnimals
- true to only return items, false to possibly return a mobfullName
- null, or the secret identity namesubType
- null, "", or the resource subTypemakeItemResource(int)
,
makeItemResource(int, String)
int getRandomResourceOfMaterial(int material)
material
- the material type codeMaterialLibrary.DeadResourceRecord destroyResources(Room R, int howMuch, int finalMaterial, int finalSubHash, int otherMaterial, int finalOtherHash)
R
- the possessor of raw material resource itemshowMuch
- the amount to destroy, in weightfinalMaterial
- the resource code of the material to destroyfinalSubHash
- 0 or the hash of the subtypeotherMaterial
- -1, 0, or the OTHER resource code of the material to destroyfinalOtherHash
- 0 or the hash of the subtypeMaterialLibrary.DeadResourceRecord
,
destroyResourcesValue(List, int, int, int, Item, Container)
,
destroyResourcesAmt(List, int, int, String, Container)
,
destroyResources(Room, int, int, int, int, int)
int destroyResourcesValue(MOB M, int howMuch, int finalMaterial, int finalSubHash, int otherMaterial, int otherSubHash)
M
- the possessor of raw material resource itemshowMuch
- the amount to destroy, in weightfinalMaterial
- the resource code of the material to destroyfinalSubHash
- 0 or the hash of the subtypeotherMaterial
- -1, 0, or the OTHER resource code of the material to destroyotherSubHash
- 0 or the hash of the subtypedestroyResourcesValue(Room, int, int, int, int, int)
,
destroyResourcesValue(MOB, int, int, int, int, int)
,
destroyResourcesValue(List, int, int, int, Item, Container)
,
destroyResourcesAmt(List, int, int, String, Container)
,
destroyResources(Room, int, int, int, int, int)
int destroyResourcesValue(Room R, int howMuch, int finalMaterial, int finalSubHash, int otherMaterial, int otherSubHash)
R
- the possessor of raw material resource itemshowMuch
- the amount to destroy, in weightfinalMaterial
- the resource code of the material to destroyfinalSubHash
- 0 or the hash of the subtypeotherMaterial
- -1, 0, or the OTHER resource code of the material to destroyotherSubHash
- 0 or the hash of the subtypedestroyResourcesValue(Room, int, int, int, int, int)
,
destroyResourcesValue(MOB, int, int, int, int, int)
,
destroyResourcesValue(List, int, int, int, Item, Container)
,
destroyResourcesAmt(List, int, int, String, Container)
,
destroyResources(Room, int, int, int, int, int)
int destroyResourcesValue(java.util.List<Item> V, int howMuch, int finalMaterial, int otherMaterial, Item never, Container C)
V
- the list of raw material resource itemshowMuch
- the amount to destroy, in weightfinalMaterial
- the resource code of the material to destroyotherMaterial
- -1, 0, or the OTHER resource code of the material to destroynever
- null, or a specific item to never destroy no matter whatC
- the container in which the items must be founddestroyResourcesValue(Room, int, int, int, int, int)
,
destroyResourcesValue(MOB, int, int, int, int, int)
,
destroyResourcesValue(List, int, int, int, Item, Container)
,
destroyResourcesAmt(List, int, int, String, Container)
,
destroyResources(Room, int, int, int, int, int)
int destroyResourcesAmt(MOB E, int howMuch, int resourceCode, java.lang.String subType, Container C)
E
- the possessor of raw material resource itemshowMuch
- the amount to destroy, in weightresourceCode
- the resource code of the material to destroysubType
- null, "", or the sub type of the resourceC
- the container in which the items must be founddestroyResourcesAmt(List, int, int, String, Container)
,
destroyResourcesAmt(Room, int, int, String, Container)
,
destroyResourcesValue(List, int, int, int, Item, Container)
,
destroyResources(Room, int, int, int, int, int)
int destroyResourcesAmt(Room E, int howMuch, int resourceCode, java.lang.String subType, Container C)
E
- the possessor of raw material resource itemshowMuch
- the amount to destroy, in weightresourceCode
- the resource code of the material to destroysubType
- null, "", or the sub type of the resourceC
- the container in which the items must be founddestroyResourcesAmt(List, int, int, String, Container)
,
destroyResourcesAmt(MOB, int, int, String, Container)
,
destroyResourcesValue(List, int, int, int, Item, Container)
,
destroyResources(Room, int, int, int, int, int)
int destroyResourcesAmt(java.util.List<Item> V, int howMuch, int finalMaterial, java.lang.String subType, Container C)
V
- the list of raw material resource itemshowMuch
- the amount to destroy, in weightfinalMaterial
- the resource code of the material to destroysubType
- null, "", or the sub type of the resourceC
- the container in which the items must be founddestroyResourcesAmt(MOB, int, int, String, Container)
,
destroyResourcesAmt(Room, int, int, String, Container)
,
destroyResourcesValue(List, int, int, int, Item, Container)
,
destroyResources(Room, int, int, int, int, int)
RawMaterial fetchFoundOtherEncoded(Room E, java.lang.String otherRequired)
E
- the possessor of possible raw material itemsotherRequired
- the resource name, or !material typefetchFoundOtherEncoded(MOB, String)
RawMaterial fetchFoundOtherEncoded(MOB E, java.lang.String otherRequired)
E
- the possessor of possible raw material itemsotherRequired
- the resource name, or !material typefetchFoundOtherEncoded(Room, String)
int findNumberOfResourceLike(Room E, RawMaterial resource)
E
- the possessor of possible raw material itemsresource
- the resource item to match others againstfindNumberOfResourceLike(MOB, RawMaterial)
int findNumberOfResourceLike(MOB E, RawMaterial resource)
E
- the possessor of possible raw material itemsresource
- the resource item to match others againstfindNumberOfResourceLike(Room, RawMaterial)
RawMaterial findMostOfMaterial(Room E, int material)
E
- the possessor of possible raw material itemsmaterial
- the material type code numberfindMostOfMaterial(MOB, int)
,
findMostOfMaterial(MOB, String)
,
findMostOfMaterial(Room, String)
RawMaterial findMostOfMaterial(MOB E, int material)
E
- the possessor of possible raw material itemsmaterial
- the material type code numberfindMostOfMaterial(MOB, String)
,
findMostOfMaterial(Room, int)
,
findMostOfMaterial(Room, String)
RawMaterial findMostOfMaterial(Room E, java.lang.String other)
E
- the possessor of possible raw material itemsother
- the material type name, with optional subtype in parenthesisfindMostOfMaterial(MOB, int)
,
findMostOfMaterial(MOB, String)
,
findMostOfMaterial(Room, int)
RawMaterial findMostOfMaterial(MOB E, java.lang.String other)
E
- the possessor of possible raw material itemsother
- the material type name, with optional subtype in parenthesisfindMostOfMaterial(MOB, int)
,
findMostOfMaterial(Room, int)
,
findMostOfMaterial(Room, String)
RawMaterial findFirstResource(Room E, int resource)
E
- the possessor of possible raw material itemsresource
- the resource code numberfindFirstResource(MOB, int)
,
findFirstResource(MOB, String)
,
findFirstResource(Room, String)
RawMaterial findFirstResource(MOB E, int resource)
E
- the possessor of possible raw material itemsresource
- the resource code numberfindFirstResource(MOB, String)
,
findFirstResource(Room, int)
,
findFirstResource(Room, String)
RawMaterial findFirstResource(Room E, java.lang.String other)
E
- the possessor of possible raw material itemsother
- the resource name, with optional subtype in parenthesisfindFirstResource(MOB, int)
,
findFirstResource(MOB, String)
,
findFirstResource(Room, int)
RawMaterial findFirstResource(MOB E, java.lang.String other)
E
- the possessor of possible raw material itemsother
- the resource name, with optional subtype in parenthesisfindFirstResource(MOB, int)
,
findFirstResource(Room, int)
,
findFirstResource(Room, String)
Item unbundle(Item I, int number, Container C)
I
- the resource bundle to split upnumber
- the number of 1 pounders to removeC
- the container of the bundle and the 1 pounderssplitBundle(Item, int, Container)
Item splitBundle(Item I, int size, Container C)
I
- the bundled itemsize
- the amount of the bundle to split outC
- the container I is in, and which the split goes intounbundle(Item, int, Container)
boolean rebundle(Item I)
I
- the raw material item to rebundleunbundle(Item, int, Container)
,
rebundle(Item)
,
splitBundle(Item, int, Container)
void addEffectsToResource(Item I)
I
- the raw material itemboolean quickDestroy(Item I)
I
- null, or an item to destroyvoid adjustResourceName(Item I)
I
- the raw material item to namemakeResourceBetterName(int, String, boolean)
,
makeResourceSimpleName(int, String)
java.lang.String makeResourceSimpleName(int rscCode, java.lang.String subType)
rscCode
- the resource codesubType
- "", null, or a subTypemakeResourceBetterName(int, String, boolean)
,
adjustResourceName(Item)
java.lang.String makeResourceBetterName(int rscCode, java.lang.String subType, boolean plural)
rscCode
- the resource codesubType
- null, "" or the subTypeplural
- true to make the name plural (more than 1), or false singularmakeResourceSimpleName(int, String)
,
adjustResourceName(Item)
java.lang.String getGeneralItemType(Item I)
I
- the item to get the general type ofboolean isResourceCodeRoomMapped(int resourceCode)
resourceCode
- the resource codeint getBurnDuration(Environmental E)
E
- the item to check