civquest.gameChange
Class AbstractFieldUnitChange

java.lang.Object
  extended bycivquest.gameChange.AbstractFieldUnitChange
All Implemented Interfaces:
FieldChange, GameChange, UnitChange
Direct Known Subclasses:
MoveUnit

public abstract class AbstractFieldUnitChange
extends java.lang.Object
implements FieldChange, UnitChange

AbstractFieldUnitChange.java


Field Summary
protected  Coordinate[] coords
           
protected  java.lang.String name
           
protected  long[] unitIDs
           
 
Fields inherited from interface civquest.gameChange.UnitChange
ADD_UNIT, NOT_KNOWN, RESET_UNIT_TIME
 
Constructor Summary
AbstractFieldUnitChange()
           
AbstractFieldUnitChange(Coordinate[] coords, long[] unitIDs)
           
AbstractFieldUnitChange(Coordinate coord, long unitID)
           
 
Method Summary
 Coordinate[] getCoords()
          Returns the Coordinate(s) of the Field(s) affected by this FieldChange.
 long[] getUnitIDs()
          Returns the information about all units (usually exactly one unit will be affected, but there may be special cases) affected by this UnitChange.
 void notifyListeners()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface civquest.gameChange.GameChange
execute
 

Field Detail

unitIDs

protected long[] unitIDs

coords

protected Coordinate[] coords

name

protected java.lang.String name
Constructor Detail

AbstractFieldUnitChange

public AbstractFieldUnitChange()

AbstractFieldUnitChange

public AbstractFieldUnitChange(Coordinate coord,
                               long unitID)

AbstractFieldUnitChange

public AbstractFieldUnitChange(Coordinate[] coords,
                               long[] unitIDs)
Method Detail

getCoords

public Coordinate[] getCoords()
Description copied from interface: FieldChange
Returns the Coordinate(s) of the Field(s) affected by this FieldChange. Implementors may define which index has which meaning (an example is: FieldChange moveUnit, index 0 = source-field, index 1 = dest-field).

Specified by:
getCoords in interface FieldChange
Returns:
the Coordinate(s) of the Field(s) affected by this FieldChange

getUnitIDs

public long[] getUnitIDs()
Description copied from interface: UnitChange
Returns the information about all units (usually exactly one unit will be affected, but there may be special cases) affected by this UnitChange. Implementors may define which index has which meaning. If a value is >= 0, it is the ID of a unit affected by this UnitChange. If a value is < 0, it indicates some special case/event according to the constants defined above.

Specified by:
getUnitIDs in interface UnitChange
Returns:
an array as specified above

notifyListeners

public void notifyListeners()
Specified by:
notifyListeners in interface GameChange