Home

Entwicklung und Programmierung

Vor- und Nachteile

Über diese Erweiterung lassen sich Vor- und Nachteile definieren.

Schrift

@XML(type=XML.Type.TAG,value="traitdef")
public class Trait extends BasicRulePluginData implements Comparable {
    
    public final static int ADVANTAGE     = 0;
    public final static int DISADVANTAGE  = 1;
    public final static int BAD_ATTRIBUTE = 2;
    public final static int GIFT          = 3;
    
    public final static int GENERATION = 1;
    public final static int COMBAT     = 2;
    
    public final static String[] TYPE_NAMES = {
        Localizer.getString("trait.type.advant"),
        Localizer.getString("trait.type.disadv"),
        Localizer.getString("trait.type.badattr"),
        Localizer.getString("trait.type.gift")
    };
    private final static String[] XML_TYPE_NAMES = {"advant","disadv","badattr","gift"};
    
    @XML(type=XML.Type.ATTRIBUTE,value="name")
    protected String name;
    @XML(type=XML.Type.ATTRIBUTE,value="id")
    protected String id;
    @XML(type=XML.Type.ATTRIBUTE,value="type",mapping="mapType")
    protected int    type;
    @XML(type=XML.Type.ATTRIBUTE,value="gp")
    protected double gp;
    @XML(type=XML.Type.ATTRIBUTE,value="multi",getter="mayBeChoosenMultiple",setter="setCanBeChoosenMultiple")
    protected boolean multi;
    @XML(type=XML.Type.ATTRIBUTE,value="free",getter="isFreeSelectable",setter="setFreeSelectable")
    protected boolean free;
    
    /** Selectable options */
    @XML(type=XML.Type.TAG,value="traitopt",setter="addOption",useParamType=true)
    protected ArrayList<TraitOption> options;
    /** Requirements for this trait */
    @XML(type=XML.Type.TAG,value="requires",setter="setRequirements",getter="getRequirements")
    protected ArrayList<Requirement> requires;
    /** Modifications through this trait */
    @XML(type=XML.Type.TAG,value="modlist",setter="setModifications",getter="getModifications")
    protected ArrayList modifies;
    /** The ID of the next trait to which this trait can be increased to */
    @XML(type=XML.Type.ATTRIBUTE,value="next")
    protected String next;
    /** The ID of the previous trait to which this trait can be decreased to */
    @XML(type=XML.Type.ATTRIBUTE,value="prev")
    protected String previous;