civquest.gameChange
Class AbstractFieldUnitPlayerChange
java.lang.Object
civquest.gameChange.AbstractFieldUnitPlayerChange
- All Implemented Interfaces:
- FieldChange, GameChange, PlayerChange, UnitChange
- public abstract class AbstractFieldUnitPlayerChange
- extends java.lang.Object
- implements FieldChange, UnitChange, PlayerChange
Method Summary |
Coordinate[] |
getCoords()
Returns the Coordinate(s) of the Field(s) affected by this FieldChange. |
int[] |
getPlayerIDs()
Returns information about all players affected by this PlayerChange. |
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 |
coords
protected Coordinate[] coords
unitIDs
protected long[] unitIDs
playerIDs
protected int[] playerIDs
name
protected java.lang.String name
AbstractFieldUnitPlayerChange
public AbstractFieldUnitPlayerChange(Coordinate coord,
long unitID,
int playerID)
AbstractFieldUnitPlayerChange
public AbstractFieldUnitPlayerChange(Coordinate[] coords,
long[] unitIDs,
int[] playerIDs)
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
getPlayerIDs
public int[] getPlayerIDs()
- Description copied from interface:
PlayerChange
- Returns information about all players affected by this PlayerChange. Implementors may define
which index has which meaning (for example: PlayerChange = TransferMoney, index 0 = player loosing money, index 1 = player
getting the money).
A value >= 0 indicates the id of a player, a value < 0 must be one of the constants defined above.
- Specified by:
getPlayerIDs
in interface PlayerChange
- Returns:
- int-array as described above
notifyListeners
public void notifyListeners()
- Specified by:
notifyListeners
in interface GameChange