Added an optional array to store colorization classes for a character component
class. Most users of the Cast system will be recoloring their character components and this allows such users to avoid using the sort of "component constraints" system that Yohoho uses when they don't need all the weird stuff like starter status or activation cost. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3719 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: ComponentClass.java,v 1.10 2004/08/27 02:12:25 mdb Exp $
|
// $Id$
|
||||||
//
|
//
|
||||||
// Narya library - tools for developing networked games
|
// Narya library - tools for developing networked games
|
||||||
// Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved
|
// Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved
|
||||||
@@ -25,6 +25,7 @@ import java.io.Serializable;
|
|||||||
|
|
||||||
import com.samskivert.util.ArrayIntSet;
|
import com.samskivert.util.ArrayIntSet;
|
||||||
import com.samskivert.util.SortableArrayList;
|
import com.samskivert.util.SortableArrayList;
|
||||||
|
import com.samskivert.util.StringUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Denotes a class of components to which {@link CharacterComponent}
|
* Denotes a class of components to which {@link CharacterComponent}
|
||||||
@@ -111,18 +112,13 @@ public class ComponentClass implements Serializable
|
|||||||
/** The default render priority. */
|
/** The default render priority. */
|
||||||
public int renderPriority;
|
public int renderPriority;
|
||||||
|
|
||||||
/**
|
/** The color classes to use when recoloring components of this class. May
|
||||||
* Creates a component class with the specified name and default
|
* be null if a system does not use recolorable components. */
|
||||||
* render priority.
|
public String[] colors;
|
||||||
*/
|
|
||||||
public ComponentClass (String name, int defaultRenderPriority)
|
|
||||||
{
|
|
||||||
this.name = name;
|
|
||||||
this.renderPriority = defaultRenderPriority;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an uninitialized instance suitable for unserialization.
|
* Creates an uninitialized instance suitable for unserialization or
|
||||||
|
* population during XML parsing.
|
||||||
*/
|
*/
|
||||||
public ComponentClass ()
|
public ComponentClass ()
|
||||||
{
|
{
|
||||||
@@ -187,7 +183,8 @@ public class ComponentClass implements Serializable
|
|||||||
*/
|
*/
|
||||||
public String toString ()
|
public String toString ()
|
||||||
{
|
{
|
||||||
return "[name=" + name + ", renderPriority=" + renderPriority + "]";
|
return "[name=" + name + ", renderPriority=" + renderPriority +
|
||||||
|
", colors=" + StringUtil.toString(colors) + "]";
|
||||||
}
|
}
|
||||||
|
|
||||||
/** A list of render priority overrides. */
|
/** A list of render priority overrides. */
|
||||||
@@ -195,5 +192,5 @@ public class ComponentClass implements Serializable
|
|||||||
|
|
||||||
/** Increase this value when object's serialized state is impacted by
|
/** Increase this value when object's serialized state is impacted by
|
||||||
* a class change (modification of fields, inheritance). */
|
* a class change (modification of fields, inheritance). */
|
||||||
private static final long serialVersionUID = 2;
|
private static final long serialVersionUID = 3;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user