net.sf.freecol.common.model
Class Feature

java.lang.Object
  extended by net.sf.freecol.common.model.FreeColObject
      extended by net.sf.freecol.common.model.Feature
Direct Known Subclasses:
Ability, Modifier

public abstract class Feature
extends FreeColObject

The Feature class encapsulates a bonus or penalty that can be applied to any action within the game, most obviously combat.


Field Summary
 
Fields inherited from class net.sf.freecol.common.model.FreeColObject
ID_ATTRIBUTE_TAG
 
Constructor Summary
Feature()
           
 
Method Summary
 boolean appliesTo(FreeColGameObjectType objectType)
          Returns true if the appliesTo method of at least one Scope object returns true.
 boolean appliesTo(FreeColGameObjectType objectType, Turn turn)
          Returns true if the appliesTo method of at least one Scope object returns true.
 boolean equals(java.lang.Object o)
           
 Turn getFirstTurn()
          Get the firstTurn value.
 Turn getLastTurn()
          Get the LastTurn value.
 java.util.List<Scope> getScopes()
          Get the Scopes value.
 FreeColGameObjectType getSource()
          Get the Source value.
 int hashCode()
           
 boolean hasScope()
          Get the Scope value.
 boolean hasTimeLimit()
          Get the TimeLimit value.
 boolean isOutOfDate(Turn turn)
          Returns true if the Feature has an lastTurn turn smaller than the turn given.
 void setFirstTurn(Turn newFirstTurn)
          Set the firstTurn value.
 void setLastTurn(Turn newLastTurn)
          Set the LastTurn value.
 void setScopes(java.util.List<Scope> newScopes)
          Set the Scopes value.
 void setSource(FreeColGameObjectType newSource)
          Set the Source value.
 
Methods inherited from class net.sf.freecol.common.model.FreeColObject
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAttribute, getAttribute, getAttribute, getAttribute, getId, getPropertyChangeListeners, getPropertyChangeListeners, getXMLElementTagName, hasAbility, hasAttribute, hasListeners, readFromXML, readFromXMLElement, removePropertyChangeListener, removePropertyChangeListener, toXML, toXML, toXML, toXMLElement, toXMLElement, toXMLElement, toXMLElement, toXMLElementPartial, writeAttribute, writeFreeColGameObject
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Feature

public Feature()
Method Detail

hasTimeLimit

public final boolean hasTimeLimit()
Get the TimeLimit value.

Returns:
a boolean value

hasScope

public final boolean hasScope()
Get the Scope value.

Returns:
a boolean value

getScopes

public final java.util.List<Scope> getScopes()
Get the Scopes value.

Returns:
a List value

setScopes

public final void setScopes(java.util.List<Scope> newScopes)
Set the Scopes value.

Parameters:
newScopes - The new Scopes value.

getFirstTurn

public final Turn getFirstTurn()
Get the firstTurn value.

Returns:
a Turn value

setFirstTurn

public final void setFirstTurn(Turn newFirstTurn)
Set the firstTurn value.

Parameters:
newFirstTurn - The new FirstTurn value.

getLastTurn

public final Turn getLastTurn()
Get the LastTurn value.

Returns:
a Turn value

setLastTurn

public final void setLastTurn(Turn newLastTurn)
Set the LastTurn value.

Parameters:
newLastTurn - The new LastTurn value.

getSource

public final FreeColGameObjectType getSource()
Get the Source value.

Returns:
a String value

setSource

public final void setSource(FreeColGameObjectType newSource)
Set the Source value.

Parameters:
newSource - The new Source value.

appliesTo

public boolean appliesTo(FreeColGameObjectType objectType)
Returns true if the appliesTo method of at least one Scope object returns true.

Parameters:
objectType - a FreeColGameObjectType value
Returns:
a boolean value

appliesTo

public boolean appliesTo(FreeColGameObjectType objectType,
                         Turn turn)
Returns true if the appliesTo method of at least one Scope object returns true.

Parameters:
objectType - a FreeColGameObjectType value
turn - a Turn value
Returns:
a boolean value

isOutOfDate

public boolean isOutOfDate(Turn turn)
Returns true if the Feature has an lastTurn turn smaller than the turn given.

Parameters:
turn - a Turn value
Returns:
a boolean value

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object