jurpe.system.generation
Class RandomNames

java.lang.Object
  extended by jurpe.containers.XMLCollection
      extended by jurpe.system.generation.RandomNames

public final class RandomNames
extends XMLCollection

Class for creating random names for monsters, items, and such. Random names may be composed by 2 or 3 words. In case of 2 words they are in the form attribute+name, ie: Red Dragon, in case of 3 words they are in the form attribute+name+geography, ie: Red Dragon of the Mysty Lands. Strings are read from an XML file like dictionary.xml. You may specify tags to read from. When read, strings are stored in ArrayList of ValuedString objects. You may then ask for a string with an associated value. Higher values corresponds to rarer objects.

Author:
Alessio Saltarin

Constructor Summary
RandomNames()
          Constructor with default values.
RandomNames(java.lang.String attribute, java.lang.String name, java.lang.String geography, java.lang.String armor, java.lang.String shield)
          Constructor.
 
Method Summary
 java.lang.String getArmor(ItemValueType value)
          Get random generated armor name.
 java.lang.String getAttribute(ItemValueType value)
          Get random generated attribute (Red, Mysty, Hungry ...).
 java.lang.String getCompleteMonsterName()
          Get generated a complete Monster name (attribute+name+geography)., with a default level of 100 points.
 java.lang.String getCompleteMonsterName(int value)
          Get generated a complete Monster name (attribute+name+geography).
 java.lang.String getGeography(ItemValueType value)
          Get random generated geography (of the Red Lands, of the Misty Mountains ...).
 java.lang.String getMonsterName(ItemValueType value)
          Get random generated monster name (kavu, donkey, dragon ...).
 java.lang.String getShield(ItemValueType value)
          Get random generated shield name.
static void main(java.lang.String[] args)
          Deprecated.  
 
Methods inherited from class jurpe.containers.XMLCollection
size
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomNames

public RandomNames()
Constructor with default values.


RandomNames

public RandomNames(java.lang.String attribute,
                   java.lang.String name,
                   java.lang.String geography,
                   java.lang.String armor,
                   java.lang.String shield)
Constructor. You pass the tags to read from the XML file, ie: "MonsterName", "ItemName", "Attribute", "Geography"

Parameters:
attribute - The first tag name to be read from dictionary.xml
name - The second tag name to be read from dictionary.xml
geography - The third tag name to be read from dictionary.xml
armor - The fourth tag name to be read from dictionary.xml
shield - The fifth tag name to be read from dictionary.xml
Method Detail

getCompleteMonsterName

public java.lang.String getCompleteMonsterName()
Get generated a complete Monster name (attribute+name+geography)., with a default level of 100 points.

Returns:
random generated name for a 100 points monster

getCompleteMonsterName

public java.lang.String getCompleteMonsterName(int value)
Get generated a complete Monster name (attribute+name+geography).

Parameters:
value - monster level (monster character points) (from 40 to 140)
Returns:
random generated name for a 'value' points monster

getAttribute

public java.lang.String getAttribute(ItemValueType value)
Get random generated attribute (Red, Mysty, Hungry ...). Every attribute has an associated value in the XML dictionary.xml). Values ranges from 10 (common) to 70 (very rare or dangerous or wonderful)

Parameters:
value - Rarity or exceptionality. Range from 10 (common) to 70 (rare)
Returns:
A random generated attribute string

getGeography

public java.lang.String getGeography(ItemValueType value)
Get random generated geography (of the Red Lands, of the Misty Mountains ...). Every attribute has an associated value in the XML dictionary.xml). Values ranges from 10 (common) to 70 (very rare or dangerous or wonderful)

Parameters:
value - Rarity or exceptionality. Range from 10 (common) to 70 (rare)
Returns:
A random generated geography string

getShield

public java.lang.String getShield(ItemValueType value)
Get random generated shield name. Every attribute has an associated value in the XML dictionary.xml). Values ranges from 10 (common) to 70 (very rare or dangerous or wonderful)

Parameters:
value - Rarity or exceptionality. Range from 10 (common) to 70 (rare)
Returns:
A random generated geography string

getArmor

public java.lang.String getArmor(ItemValueType value)
Get random generated armor name. Every attribute has an associated value in the XML dictionary.xml). Values ranges from 10 (common) to 70 (very rare or dangerous or wonderful)

Parameters:
value - Rarity or exceptionality. Range from 10 (common) to 70 (rare)
Returns:
A random generated geography string

getMonsterName

public java.lang.String getMonsterName(ItemValueType value)
Get random generated monster name (kavu, donkey, dragon ...). Every attribute has an associated value in the XML dictionary.xml). Values ranges from 10 (common) to 70 (very rare or dangerous or wonderful)

Parameters:
value - Rarity or exceptionality. Range from 10 (common) to 70 (rare)
Returns:
A random generated geography string

main

public static void main(java.lang.String[] args)
Deprecated. 

For test purposes only

Parameters:
args - not used

Jurpe - Java Universal Role Playing Engine - http://jurpe.sourceforge.net