universe.server.database
Class RaceBase

java.lang.Object
  |
  +--universe.server.KeyedItem
        |
        +--universe.server.database.RaceBase
Direct Known Subclasses:
RaceRandom

public abstract class RaceBase
extends KeyedItem


Field Summary
private static java.util.Vector raceList
           
 
Fields inherited from class universe.server.KeyedItem
 
Constructor Summary
RaceBase()
          no-arg constructor as required for objects which subclass this to be serializable
RaceBase(java.lang.String key)
          This constructor is used to construct instances of this class.
 
Method Summary
static void addRace(RaceBase newRace)
          This method registers the given race as one that will be allowed to exist in the current game (which might be a smaller subset of those which are defined by the loaded scheme).
static void deleteRaces()
          This method deletes all races currently allowed in the game.
static RaceBase FindByKey(java.lang.String aKey)
          This class method returns the species instance matching the given key, or null if there isn't one.
 java.lang.String getName()
          This method simply calls getDescription (see parent class).
static RaceBase getRace(java.lang.String name)
          This method returns the race corresponding to the given name.
static java.util.Vector getRaces()
          This method returns a vector containing all of the races which are allowed to exist in the current game.
 void performLocalization()
          This method overrides that of our abstract base class to set the description and back story of the receiving RaceBase object.
static RaceBase randomlySelectedRace()
          This method returns a race randomly selected from those currently allowed in the game.
 
Methods inherited from class universe.server.KeyedItem
FindByDescriptionAndSpace, FindByKeyAndSpace, getBackStory, getDescription, getKey, hashCode, setBackStory, setDescription, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

raceList

private static java.util.Vector raceList
Constructor Detail

RaceBase

public RaceBase()
no-arg constructor as required for objects which subclass this to be serializable


RaceBase

public RaceBase(java.lang.String key)
This constructor is used to construct instances of this class.

Parameters:
key - The localization invariant unique key word used to uniquely identify a particular type of species.
See Also:
FindByKey
Method Detail

FindByKey

public static RaceBase FindByKey(java.lang.String aKey)
This class method returns the species instance matching the given key, or null if there isn't one.

Parameters:
aKey - The key word identifying the desired instance.

performLocalization

public void performLocalization()
This method overrides that of our abstract base class to set the description and back story of the receiving RaceBase object. This method will be called automatically when either our getDescription or getBackStory methods are called.

Overrides:
performLocalization in class KeyedItem
See Also:
getDescription, getBackStory

getName

public java.lang.String getName()
This method simply calls getDescription (see parent class). It is included merely for backwards compatibility.


addRace

public static void addRace(RaceBase newRace)
This method registers the given race as one that will be allowed to exist in the current game (which might be a smaller subset of those which are defined by the loaded scheme).

Parameters:
newRace - A race to be permitted in the game.
See Also:
getRaces, deleateRaces

getRaces

public static java.util.Vector getRaces()
This method returns a vector containing all of the races which are allowed to exist in the current game.


deleteRaces

public static void deleteRaces()
This method deletes all races currently allowed in the game. This would normally be done by a scenario wishing to register only a small subset of the races defined in the scheme via the addRace method.

See Also:
getRaces

randomlySelectedRace

public static RaceBase randomlySelectedRace()
This method returns a race randomly selected from those currently allowed in the game.


getRace

public static RaceBase getRace(java.lang.String name)
This method returns the race corresponding to the given name. If the given argument is equal to RaceRandom.RANDOM_KEY then a randomly selected race is returned.



Copyright © 2001 Universe Dev Team All Rights Reserved.