wyvern.kernel.combat
Class ArmorTables

java.lang.Object
  extended bywyvern.kernel.combat.ArmorTables

public final class ArmorTables
extends java.lang.Object

A totally non-OO, non-polymorphic, ugly piece of code that I'm embarrassed about. Keeps information about the various Armor classes in tables of various kinds. Will go away soon.

Version:
1.0, Jun 09, 1998
Author:
Steve Yegge

Method Summary
static java.lang.Class expectedBodyPart(java.lang.Class type)
          Returns the name of the body part we expect to be able to hang the passed armor on.
static java.lang.String getPartName(java.lang.Class type)
          Returns the part-name of the passed armor-slot type, e.g.
static java.lang.String getPluralName(java.lang.Class type)
          Returns the plural form for the generic name of the passed armor type.
static java.lang.String getPluralPartName(java.lang.Class type)
          Returns the plural part-name of the passed armor-slot type, e.g.
static java.lang.String getSingularName(java.lang.Class type)
          Returns the singular form for the generic name of the passed armor type.
static int getWearTime(Armor armor)
          Returns the time it takes to wear or remove the item.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getSingularName

public static java.lang.String getSingularName(java.lang.Class type)
Returns the singular form for the generic name of the passed armor type. (E.g. "an amulet").

Parameters:
type - the armor type
Returns:
the singular form

getPluralName

public static java.lang.String getPluralName(java.lang.Class type)
Returns the plural form for the generic name of the passed armor type. (E.g. "boots").

Parameters:
type - the armor type
Returns:
the plural form

getWearTime

public static int getWearTime(Armor armor)
Returns the time it takes to wear or remove the item.

Returns:
the event delay in millis

expectedBodyPart

public static java.lang.Class expectedBodyPart(java.lang.Class type)
Returns the name of the body part we expect to be able to hang the passed armor on. It's not required to go on the returned body-part type; you can invent new body parts that can wear the existing armor types. This method is for generating a suggestion if the user tries to wear something they don't have the required parts for.

Parameters:
type - the armor type
Returns:
a sugested body-part class

getPartName

public static java.lang.String getPartName(java.lang.Class type)
Returns the part-name of the passed armor-slot type, e.g. "arm".

Parameters:
type - the armor slot type
Returns:
the body part name

getPluralPartName

public static java.lang.String getPluralPartName(java.lang.Class type)
Returns the plural part-name of the passed armor-slot type, e.g. "arms".

Parameters:
type - the armor slot class
Returns:
the plural body-part name