dip.world
Class VictoryConditions

java.lang.Object
  extended bydip.world.VictoryConditions
All Implemented Interfaces:
java.io.Serializable

public class VictoryConditions
extends java.lang.Object
implements java.io.Serializable

Establishes the conditions required to determine who wins a game, and contains methods to evaluate if these condtions are met during adjudication.

See Also:
Serialized Form

Field Summary
protected  java.util.List evalResults
           
protected  int initialYear
           
protected  int maxGameTimeYears
           
protected  int maxYearsNoSCChange
           
protected  int numSCForVictory
           
 
Constructor Summary
VictoryConditions(int numSCForVictory, int maxYearsNoSCChange, int maxGameTimeYears, Phase initialPhase)
          VictoryConditions constructor
 
Method Summary
 boolean evaluate(Adjudicator adjudicator, Adjustment.AdjustmentInfoMap adjMap)
          Evaluates the victory conditions.
 boolean evaluate(TurnState turnState, Adjustment.AdjustmentInfoMap adjMap)
          Evaluates the victory conditions.
 java.util.List getEvaluationResults()
          Returns the Result(s) of evaluate().
 int getMaxGameDurationYears()
          Returns number maximum game duration, in years.
 int getSCsRequiredForVictory()
          Returns the number of Supply Centers required for victory.
 int getYearsWithoutSCChange()
          Returns number of Years without any Supply Center being captured for the game to end.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

numSCForVictory

protected final int numSCForVictory

maxYearsNoSCChange

protected final int maxYearsNoSCChange

maxGameTimeYears

protected final int maxGameTimeYears

initialYear

protected final int initialYear

evalResults

protected transient java.util.List evalResults
Constructor Detail

VictoryConditions

public VictoryConditions(int numSCForVictory,
                         int maxYearsNoSCChange,
                         int maxGameTimeYears,
                         Phase initialPhase)
VictoryConditions constructor

Method Detail

getSCsRequiredForVictory

public int getSCsRequiredForVictory()
Returns the number of Supply Centers required for victory.


getYearsWithoutSCChange

public int getYearsWithoutSCChange()
Returns number of Years without any Supply Center being captured for the game to end.


getMaxGameDurationYears

public int getMaxGameDurationYears()
Returns number maximum game duration, in years.


getEvaluationResults

public java.util.List getEvaluationResults()
Returns the Result(s) of evaluate(). This will return an empty list if evaluate() has not been called or returned false.


evaluate

public boolean evaluate(Adjudicator adjudicator,
                        Adjustment.AdjustmentInfoMap adjMap)
Evaluates the victory conditions. Returns true if victory has been achieved (via any condition).

This method defers to the evaluate(TurnState, Adjustment.AdjustmentInfoMap) method.

Parameters:
adjMap - adjustment map (as returned by Adjustment.getAdjustmentInfo())
adjudicator - an Adjudicator object

evaluate

public boolean evaluate(TurnState turnState,
                        Adjustment.AdjustmentInfoMap adjMap)
Evaluates the victory conditions. Returns true if victory has been achieved (via any condition).

Parameters:
adjMap - adjustment map (as returned by Adjustment.getAdjustmentInfo())
turnState - the TurnState


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