dip.world.variant.data
Class Variant

java.lang.Object
  extended bydip.world.variant.data.Variant
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable

public class Variant
extends java.lang.Object
implements java.lang.Cloneable, java.lang.Comparable

A Variant.


Nested Class Summary
static class Variant.NameValuePair
          Class of Rule Option name/value pairs
 
Constructor Summary
Variant()
          Construct a new Variant object
 
Method Summary
 java.lang.Object clone()
          Creates a deep clone of all data EXCEPT InitialState / SupplyCenter data / Name / Description
 int compareTo(java.lang.Object o)
          Compares based on Name
 java.lang.String[] getAliases()
          The aliases (alternate names) of the variant.
 boolean getBCYearsAllowed()
          Gets if BC Years are allowed with this Variant
 BorderData[] getBorderData()
          Gets the BorderData associated with this Variant
 MapGraphic getDefaultMapGraphic()
          Gets the default MapGraphic; if there is no default, returns the first one.
 java.lang.String getDescription()
          Description for variant; this is typically HTML encoded.
 java.lang.Object[] getHTMLSummaryArguments()
          Gets the arguments for an HTML description, suitable for insertion inside an appropriately-marked HTML template (arguments are surrounded by curly braces).
 InitialState[] getInitialStates()
          The starting InitialStates.
 MapGraphic[] getMapGraphics()
          The mapGraphics associated with this Variant.
 MapGraphic getMapGrapic(java.lang.String mgName)
          Finds the MapGraphic by name; case insensitive.
 int getMaxGameTimeYears()
          Victory Conditions: Maximum game duration, in years.
 int getMaxYearsNoSCChange()
          Victory Conditions: Maximum years without a supply-center ownership change before game ends.
 java.lang.String getName()
          The name of the variant.
 int getNumSCForVictory()
          Victory Conditions: Number of Supply Centers required for victory.
 Power[] getPowers()
          Returns Powers associated with this Variant.
 ProvinceData[] getProvinceData()
          The ProvinceData associated with this Variant
 Variant.NameValuePair[] getRuleOptionNVPs()
          The RuleOptions (as name-value pairs) associated with this Variant
 Phase getStartingPhase()
          The starting time.
 SupplyCenter[] getSupplyCenters()
          Returns SupplyCenter objects
 float getVersion()
          Version of this variant
 boolean isDefault()
          Whether this is the default variant.
 void setActiveState(boolean[] values)
          Changes the active/inactive state of a power.
 void setAliases(java.lang.String[] aliases)
          Set the alises.
 void setBCYearsAllowed(boolean value)
          Sets whether BC years (negative years) are allowed
 void setBorderData(BorderData[] value)
          Sets the BorderData associated with this Variant
 void setDefault(boolean value)
          Set if this variant is the default variant.
 void setDescription(java.lang.String value)
          Set the description for this variant.
 void setInitialStates(java.util.List stateList)
          Sets the InitialStates, from a List
 void setMapGraphics(java.util.List mgList)
          Sets the MapGraphics, from a List
 void setMaxGameTimeYears(int value)
          Victory Conditions: Maximum game duration, in years.
 void setMaxYearsNoSCChange(int value)
          Victory Conditions: Maximum years without a supply-center ownership change before game ends.
 void setName(java.lang.String value)
          Set the variant name.
 void setNumSCForVictory(int value)
          Victory Conditions: Number of Supply Centers required for victory.
 void setPowers(java.util.List powerList)
          Sets the Powers, from a List
 void setProvinceData(ProvinceData[] value)
          Sets the ProvinceData associated with this Variant
 void setRuleOptionNVPs(java.util.List nvpList)
          Sets the RuleOptions (as a List of name-value pairs) associated with this Variant
 void setStartingPhase(Phase value)
          Set the starting phase for this variant.
 void setSupplyCenters(java.util.List supplyCenterList)
          Sets the supply centers, from a List
 void setVersion(float value)
          Set the version of this variant
 java.lang.String toString()
          For debugging only!
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Variant

public Variant()
Construct a new Variant object

Method Detail

getName

public java.lang.String getName()
The name of the variant.


getAliases

public java.lang.String[] getAliases()
The aliases (alternate names) of the variant. Never null.


getVersion

public float getVersion()
Version of this variant


isDefault

public boolean isDefault()
Whether this is the default variant.


getDescription

public java.lang.String getDescription()
Description for variant; this is typically HTML encoded.


getStartingPhase

public Phase getStartingPhase()
The starting time.


getInitialStates

public InitialState[] getInitialStates()
The starting InitialStates.


getPowers

public Power[] getPowers()
Returns Powers associated with this Variant.


getSupplyCenters

public SupplyCenter[] getSupplyCenters()
Returns SupplyCenter objects


getNumSCForVictory

public int getNumSCForVictory()
Victory Conditions: Number of Supply Centers required for victory.


getMaxYearsNoSCChange

public int getMaxYearsNoSCChange()
Victory Conditions: Maximum years without a supply-center ownership change before game ends.


getMaxGameTimeYears

public int getMaxGameTimeYears()
Victory Conditions: Maximum game duration, in years.


getMapGraphics

public MapGraphic[] getMapGraphics()
The mapGraphics associated with this Variant.


getProvinceData

public ProvinceData[] getProvinceData()
The ProvinceData associated with this Variant


getRuleOptionNVPs

public Variant.NameValuePair[] getRuleOptionNVPs()
The RuleOptions (as name-value pairs) associated with this Variant


getBorderData

public BorderData[] getBorderData()
Gets the BorderData associated with this Variant


getBCYearsAllowed

public boolean getBCYearsAllowed()
Gets if BC Years are allowed with this Variant


setName

public void setName(java.lang.String value)
Set the variant name.


setAliases

public void setAliases(java.lang.String[] aliases)
Set the alises. Null is not allowed.


setVersion

public void setVersion(float value)
Set the version of this variant


setDefault

public void setDefault(boolean value)
Set if this variant is the default variant.


setDescription

public void setDescription(java.lang.String value)
Set the description for this variant.


setStartingPhase

public void setStartingPhase(Phase value)
Set the starting phase for this variant.


setNumSCForVictory

public void setNumSCForVictory(int value)
Victory Conditions: Number of Supply Centers required for victory.


setMaxYearsNoSCChange

public void setMaxYearsNoSCChange(int value)
Victory Conditions: Maximum years without a supply-center ownership change before game ends.


setMaxGameTimeYears

public void setMaxGameTimeYears(int value)
Victory Conditions: Maximum game duration, in years.


setProvinceData

public void setProvinceData(ProvinceData[] value)
Sets the ProvinceData associated with this Variant


setBorderData

public void setBorderData(BorderData[] value)
Sets the BorderData associated with this Variant


setBCYearsAllowed

public void setBCYearsAllowed(boolean value)
Sets whether BC years (negative years) are allowed


setMapGraphics

public void setMapGraphics(java.util.List mgList)
Sets the MapGraphics, from a List


setPowers

public void setPowers(java.util.List powerList)
Sets the Powers, from a List


setInitialStates

public void setInitialStates(java.util.List stateList)
Sets the InitialStates, from a List


setSupplyCenters

public void setSupplyCenters(java.util.List supplyCenterList)
Sets the supply centers, from a List


setRuleOptionNVPs

public void setRuleOptionNVPs(java.util.List nvpList)
Sets the RuleOptions (as a List of name-value pairs) associated with this Variant


setActiveState

public void setActiveState(boolean[] values)
Changes the active/inactive state of a power. The number of values must equal the number of powers.


compareTo

public int compareTo(java.lang.Object o)
Compares based on Name

Specified by:
compareTo in interface java.lang.Comparable

getMapGrapic

public MapGraphic getMapGrapic(java.lang.String mgName)
Finds the MapGraphic by name; case insensitive.


getDefaultMapGraphic

public MapGraphic getDefaultMapGraphic()
Gets the default MapGraphic; if there is no default, returns the first one.


getHTMLSummaryArguments

public java.lang.Object[] getHTMLSummaryArguments()
Gets the arguments for an HTML description, suitable for insertion inside an appropriately-marked HTML template (arguments are surrounded by curly braces).

Arguments for the HTML template are:

  1. Variant name
  2. variant-description (note: may be in html)
  3. Supply centers for victory
  4. Starting season
  5. Starting year
  6. Starting phase
  7. Powers (comma-separated list)
  8. Number of Powers
8 arguments are given in total.


clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Creates a deep clone of all data EXCEPT InitialState / SupplyCenter data / Name / Description

Throws:
java.lang.CloneNotSupportedException

toString

public java.lang.String toString()
For debugging only!



Copyright 2002-2004 Zachary DelProposto / jDip Development Team. All Rights Reserved.