public class ColorPository extends Object implements Serializable
| Modifier and Type | Class and Description |
|---|---|
static class |
ColorPository.ClassRecord
Used to store information on a class of colors.
|
static class |
ColorPository.ColorRecord
Used to store information on a particular color.
|
| Constructor and Description |
|---|
ColorPository() |
| Modifier and Type | Method and Description |
|---|---|
void |
addClass(ColorPository.ClassRecord record)
Adds a fully configured color class record to the pository.
|
Iterator<ColorPository.ClassRecord> |
enumerateClasses()
Returns an iterator over all color classes in this pository.
|
int[] |
enumerateColorIds(String className)
Returns an array containing the ids of the colors in the specified class.
|
ColorPository.ColorRecord[] |
enumerateColors(String className)
Returns an array containing the records for the colors in the specified class.
|
Collection<ColorPository.ClassRecord> |
getClasses() |
ColorPository.ClassRecord |
getClassRecord(int classId)
Looks up the requested color class record.
|
ColorPository.ClassRecord |
getClassRecord(String className)
Loads up a colorization class by name and logs a warning if it doesn't exist.
|
Colorization |
getColorization(int colorPrint)
Looks up a colorization by color print.
|
Colorization |
getColorization(int classId,
int colorId)
Looks up a colorization by id.
|
Colorization |
getColorization(String className,
int colorId)
Looks up a colorization by name.
|
Colorization |
getColorization(String className,
String colorName)
Looks up a colorization by class and color names.
|
ColorPository.ColorRecord |
getColorRecord(int classId,
int colorId)
Looks up the requested color record.
|
ColorPository.ColorRecord |
getColorRecord(String className,
String colorName)
Looks up the requested color record by class and color names.
|
ColorPository.ColorRecord |
getRandomStartingColor(String className)
Returns a random starting color from the specified color class.
|
ColorPository.ColorRecord |
getRandomStartingColor(String className,
Random rand)
Returns a random starting color from the specified color class.
|
boolean |
isLegalStartColor(int colorPrint)
Returns true if the specified color is legal for use at character creation time.
|
boolean |
isLegalStartColor(int classId,
int colorId)
Returns true if the specified color is legal for use at character creation time.
|
static ColorPository |
loadColorPository(InputStream source)
Loads up a serialized ColorPository from the supplied resource manager.
|
static ColorPository |
loadColorPository(ResourceManager rmgr)
Loads up a serialized ColorPository from the supplied resource manager.
|
static void |
saveColorPository(ColorPository posit,
File root)
Serializes and saves color pository to the supplied file.
|
public Iterator<ColorPository.ClassRecord> enumerateClasses()
public Collection<ColorPository.ClassRecord> getClasses()
public ColorPository.ColorRecord[] enumerateColors(String className)
public int[] enumerateColorIds(String className)
public boolean isLegalStartColor(int colorPrint)
public boolean isLegalStartColor(int classId,
int colorId)
public ColorPository.ColorRecord getRandomStartingColor(String className)
public ColorPository.ColorRecord getRandomStartingColor(String className, Random rand)
public Colorization getColorization(int classId, int colorId)
public Colorization getColorization(int colorPrint)
public Colorization getColorization(String className, int colorId)
public Colorization getColorization(String className, String colorName)
public ColorPository.ClassRecord getClassRecord(String className)
public ColorPository.ColorRecord getColorRecord(int classId, int colorId)
public ColorPository.ColorRecord getColorRecord(String className, String colorName)
public ColorPository.ClassRecord getClassRecord(int classId)
public void addClass(ColorPository.ClassRecord record)
public static ColorPository loadColorPository(ResourceManager rmgr)
public static ColorPository loadColorPository(InputStream source)
public static void saveColorPository(ColorPository posit, File root)
Copyright © 2015. All rights reserved.