com.planet_ink.coffee_mud.Items.interfaces
Class RawMaterial.CODES

java.lang.Object
  extended by com.planet_ink.coffee_mud.Items.interfaces.RawMaterial.CODES
Enclosing interface:
RawMaterial

public static class RawMaterial.CODES
extends java.lang.Object

Global resource/raw material code data collector


Constructor Summary
RawMaterial.CODES()
          Constructs a CODES object for the current thread.
 
Method Summary
 void add(int material, java.lang.String name, java.lang.String smell, int value, int frequ, int hardness, int bouancy, boolean fish, boolean berry, boolean woody, java.lang.String abilityID)
          Adds a new resource to the official CODES object.
static int[] ALL_SBN()
          Returns an array of the numeric codes for all resources
 int[] all()
          Returns an array of the numeric codes for all resources
static int[] ALL()
          Returns an array of the numeric codes for all resources
 int[] berries()
          Returns an array of the numeric codes for the berry resources
static int[] BERRIES()
          Returns an array of the numeric codes for the berry resources
 int bouancy(int code)
          Returns the bouancy of the resource, from 0-20000
static int BOUANCY(int code)
          Returns the bouancy of the resource, from 0-20000
static RawMaterial.CODES c(byte c)
          Returns the CODES object for the given thread group code, or null
static java.util.List<java.lang.Integer> COMPOSE_RESOURCES(int mat)
          Search and compose a complete list of all resources of the given material
 java.lang.String effect(int code)
          Returns the description of the code smell
static java.lang.String EFFECT(int code)
          Returns the description of the code smell
static Ability[] EFFECTA(int code)
          Parses, if necessary, EFFECT strings into ability objects, complete with parms, ready for copying.
static java.lang.String[] EFFECTS()
          Returns the smells of the various resources
static int FIND_CaseSensitive(java.lang.String rsc)
          Returns the code of the names resource, or -1
static int FIND_IgnoreCase(java.lang.String rsc)
          Returns the code of the names resource, or -1
static int FIND_StartsWith(java.lang.String rsc)
          Returns the code of the names resource, or -1
 int[] fishes()
          Returns an array of the numeric codes for the fishy resources
static int[] FISHES()
          Returns an array of the numeric codes for the fishy resources
 int frequency(int code)
          Returns the frequency of the resource, or how rare it is.
static int FREQUENCY(int code)
          Returns the frequency of the resource, or how rare it is.
 int get(int x)
          Returns an the numeric codes of the indexes resource code
static int GET(int x)
          Returns an the numeric codes of the indexes resource code
 PairList<java.lang.Integer,java.lang.Double> getValueSortedBucket(int material)
          For the given material, returns a value-sorted list of all resources that are made of that material and their values.
 int hardness(int code)
          Returns the hardness of the resource, from 1-10
static int HARDNESS(int code)
          Returns the hardness of the resource, from 1-10
static RawMaterial.CODES instance()
          Returns the CODES object for the current thread group, or creates one.
static boolean IS_VALID(int code)
          Returns whether the code is valid
static int MOST_FREQUENT(int material)
          Returns the resource code of the most frequently found resource of the given material mask
 int mostFrequent(int material)
          Returns the resource code of the most frequently found resource of the given material mask
 java.lang.String name(int code)
          Returns the name of the code
static java.lang.String NAME(int code)
          Returns the name of the code
 java.lang.String[] names()
          Returns the names of the various resources
static java.lang.String[] NAMES()
          Returns the names of the various resources
 void replace(int resourceCode, int material, java.lang.String name, java.lang.String smell, int value, int frequ, int hardness, int bouancy, boolean fish, boolean berry, boolean woody, java.lang.String abilityID)
          Replaces a resource of the given code with new data
static void reset()
          Destroys and recreates the CODES object for the current thread group
 java.lang.String smell(int code)
          Returns the description of the code smell
static java.lang.String SMELL(int code)
          Returns the description of the code smell
static java.lang.String[] SMELLS()
          Returns the smells of the various resources
 int total()
          Returns total number of codes 0 - this-1
static int TOTAL()
          Returns total number of codes 0 - this-1
 int value(int code)
          Returns the value of the resource
static int VALUE(int code)
          Returns the value of the resource
 int[] woodies()
          Returns an array of the numeric codes for the wood-choppy resources
static int[] WOODIES()
          Returns an array of the numeric codes for the wood-choppy resources
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RawMaterial.CODES

public RawMaterial.CODES()
Constructs a CODES object for the current thread.

Method Detail

c

public static RawMaterial.CODES c(byte c)
Returns the CODES object for the given thread group code, or null

Parameters:
c - the thread group code
Returns:
the CODES object for the given thread group code, or null

instance

public static RawMaterial.CODES instance()
Returns the CODES object for the current thread group, or creates one.

Returns:
the CODES object for the current thread group, or creates one.

reset

public static void reset()
Destroys and recreates the CODES object for the current thread group


BERRIES

public static int[] BERRIES()
Returns an array of the numeric codes for the berry resources

Returns:
an array of the numeric codes for the berry resources

berries

public int[] berries()
Returns an array of the numeric codes for the berry resources

Returns:
an array of the numeric codes for the berry resources

WOODIES

public static int[] WOODIES()
Returns an array of the numeric codes for the wood-choppy resources

Returns:
an array of the numeric codes for the wood-choppy resources

woodies

public int[] woodies()
Returns an array of the numeric codes for the wood-choppy resources

Returns:
an array of the numeric codes for the wood-choppy resources

FISHES

public static int[] FISHES()
Returns an array of the numeric codes for the fishy resources

Returns:
an array of the numeric codes for the fishy resources

fishes

public int[] fishes()
Returns an array of the numeric codes for the fishy resources

Returns:
an array of the numeric codes for the fishy resources

TOTAL

public static int TOTAL()
Returns total number of codes 0 - this-1

Returns:
total number of codes 0 - this-1

total

public int total()
Returns total number of codes 0 - this-1

Returns:
total number of codes 0 - this-1

ALL_SBN

public static int[] ALL_SBN()
Returns an array of the numeric codes for all resources

Returns:
an array of the numeric codes for all resources

ALL

public static int[] ALL()
Returns an array of the numeric codes for all resources

Returns:
an array of the numeric codes for all resources

all

public int[] all()
Returns an array of the numeric codes for all resources

Returns:
an array of the numeric codes for all resources

GET

public static int GET(int x)
Returns an the numeric codes of the indexes resource code

Parameters:
x - the indexed resource code
Returns:
an the numeric codes of the indexes resource code

get

public int get(int x)
Returns an the numeric codes of the indexes resource code

Parameters:
x - the indexed resource code
Returns:
an the numeric codes of the indexes resource code

FIND_CaseSensitive

public static int FIND_CaseSensitive(java.lang.String rsc)
Returns the code of the names resource, or -1

Parameters:
rsc - the names resource
Returns:
the code of the names resource, or -1

FIND_IgnoreCase

public static int FIND_IgnoreCase(java.lang.String rsc)
Returns the code of the names resource, or -1

Parameters:
rsc - the names resource
Returns:
the code of the names resource, or -1

FIND_StartsWith

public static int FIND_StartsWith(java.lang.String rsc)
Returns the code of the names resource, or -1

Parameters:
rsc - the names resource
Returns:
the code of the names resource, or -1

IS_VALID

public static boolean IS_VALID(int code)
Returns whether the code is valid

Parameters:
code - the resource code
Returns:
whether the code is valid

NAMES

public static java.lang.String[] NAMES()
Returns the names of the various resources

Returns:
the names of the various resources

names

public java.lang.String[] names()
Returns the names of the various resources

Returns:
the names of the various resources

NAME

public static java.lang.String NAME(int code)
Returns the name of the code

Parameters:
code - the code
Returns:
the name of the code

name

public java.lang.String name(int code)
Returns the name of the code

Parameters:
code - the code
Returns:
the name of the code

SMELLS

public static java.lang.String[] SMELLS()
Returns the smells of the various resources

Returns:
the smells of the various resources

SMELL

public static java.lang.String SMELL(int code)
Returns the description of the code smell

Parameters:
code - the code smell
Returns:
the description of the code smell

smell

public java.lang.String smell(int code)
Returns the description of the code smell

Parameters:
code - the code smell
Returns:
the description of the code smell

EFFECTS

public static java.lang.String[] EFFECTS()
Returns the smells of the various resources

Returns:
the smells of the various resources

EFFECT

public static java.lang.String EFFECT(int code)
Returns the description of the code smell

Parameters:
code - the code smell
Returns:
the description of the code smell

effect

public java.lang.String effect(int code)
Returns the description of the code smell

Parameters:
code - the code smell
Returns:
the description of the code smell

VALUE

public static int VALUE(int code)
Returns the value of the resource

Parameters:
code - the resource code
Returns:
the value of the resource

value

public int value(int code)
Returns the value of the resource

Parameters:
code - the resource code
Returns:
the value of the resource

FREQUENCY

public static int FREQUENCY(int code)
Returns the frequency of the resource, or how rare it is.

Parameters:
code - the resource code
Returns:
the frequency of the resource

frequency

public int frequency(int code)
Returns the frequency of the resource, or how rare it is.

Parameters:
code - the resource code
Returns:
the frequency of the resource

MOST_FREQUENT

public static int MOST_FREQUENT(int material)
Returns the resource code of the most frequently found resource of the given material mask

Parameters:
material - the material mask
Returns:
the most common resource of that material

mostFrequent

public int mostFrequent(int material)
Returns the resource code of the most frequently found resource of the given material mask

Parameters:
material - the material mask
Returns:
the most common resource of that material

HARDNESS

public static int HARDNESS(int code)
Returns the hardness of the resource, from 1-10

Parameters:
code - the resource code
Returns:
the hardness of the resource

hardness

public int hardness(int code)
Returns the hardness of the resource, from 1-10

Parameters:
code - the resource code
Returns:
the hardness of the resource

BOUANCY

public static int BOUANCY(int code)
Returns the bouancy of the resource, from 0-20000

Parameters:
code - the resource code
Returns:
the bouancy of the resource

bouancy

public int bouancy(int code)
Returns the bouancy of the resource, from 0-20000

Parameters:
code - the resource code
Returns:
the bouancy of the resource

COMPOSE_RESOURCES

public static java.util.List<java.lang.Integer> COMPOSE_RESOURCES(int mat)
Search and compose a complete list of all resources of the given material

Parameters:
mat - the resource code
Returns:
a complete list of all resources of the given material

EFFECTA

public static Ability[] EFFECTA(int code)
Parses, if necessary, EFFECT strings into ability objects, complete with parms, ready for copying.

Parameters:
code - the material/resource code
Returns:
an ability, if any.

getValueSortedBucket

public PairList<java.lang.Integer,java.lang.Double> getValueSortedBucket(int material)
For the given material, returns a value-sorted list of all resources that are made of that material and their values. Performs caching.

Parameters:
material - the material type to get resources of
Returns:
the value-sorted list of resources and values

add

public void add(int material,
                java.lang.String name,
                java.lang.String smell,
                int value,
                int frequ,
                int hardness,
                int bouancy,
                boolean fish,
                boolean berry,
                boolean woody,
                java.lang.String abilityID)
Adds a new resource to the official CODES object. The resource code will end up being determined by the order in which resources are added. So be careful!

Parameters:
material - the material type of the new resource
name - the name of the resource
smell - the smell of the resource
value - the value of the resource in base currency
frequ - the frequency of the resource 0-10
hardness - the hardness of the resource 0-10
bouancy - the bouancy of the resource 0-10000
fish - true if its a fishy-type
berry - true if its a berry type
woody - true if its a wood-choppy type
abilityID - effects list

replace

public void replace(int resourceCode,
                    int material,
                    java.lang.String name,
                    java.lang.String smell,
                    int value,
                    int frequ,
                    int hardness,
                    int bouancy,
                    boolean fish,
                    boolean berry,
                    boolean woody,
                    java.lang.String abilityID)
Replaces a resource of the given code with new data

Parameters:
resourceCode - the old resource code
material - the material type of the new resource
name - the name of the resource
smell - the smell of the resource
value - the value of the resource in base currency
frequ - the frequency of the resource 0-10
hardness - the hardness of the resource 0-10
bouancy - the bouancy of the resource 0-10000
fish - true if its a fishy-type
berry - true if its a berry type
woody - true if its a wood-choppy type
abilityID - effects list