toroidwars.logging
Class AbstractLoggableAction<T>
java.lang.Object
toroidwars.logging.AbstractLoggableAction<T>
- Type Parameters:
T -
- All Implemented Interfaces:
- LoggableAction<T>
- Direct Known Subclasses:
- AttackedLoggableAction, AttackLoggableAction, BuildLoggableAction, ConqueredLoggableAction, PassLoggableAction, ScoutLoggableAction, TransferLoggableAction
public abstract class AbstractLoggableAction<T>
- extends java.lang.Object
- implements LoggableAction<T>
Abstract loggable action, attached to the blindrisk.interfaces.LogInfo
- Author:
- Maximillian Dupenois, Kent McClymont
- See Also:
blindrisk.interfaces.LogInfo
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
AbstractLoggableAction
protected AbstractLoggableAction(Country country,
Direction direction,
int numberOfUnits,
T result)
- Parameters:
country - the logging action relates todirection - direction the action is takennumberOfUnits - units involvedresult - the result that was returned
getDirection
public Direction getDirection()
- Specified by:
getDirection in interface LoggableAction<T>
- Returns:
- the direction involved in the action
getNumberOfUnits
public int getNumberOfUnits()
- Specified by:
getNumberOfUnits in interface LoggableAction<T>
- Returns:
- the number of units involved in the action
getCountry
public Country getCountry()
- Returns:
- the country involved in the action
getResult
public T getResult()
- Specified by:
getResult in interface LoggableAction<T>
- Returns:
- the result from the action
isAttack
public boolean isAttack()
- Specified by:
isAttack in interface LoggableAction<T>
- Returns:
- true if this action is of type attack
isAttacked
public boolean isAttacked()
- Specified by:
isAttacked in interface LoggableAction<T>
- Returns:
- true if this action is of type attacked
isConquered
public boolean isConquered()
- Specified by:
isConquered in interface LoggableAction<T>
- Returns:
- true if this action is of type conquered
isBuild
public boolean isBuild()
- Specified by:
isBuild in interface LoggableAction<T>
- Returns:
- true if this action is of type build
isTransfer
public boolean isTransfer()
- Specified by:
isTransfer in interface LoggableAction<T>
- Returns:
- true if this action is of type transfer
isPass
public boolean isPass()
- Specified by:
isPass in interface LoggableAction<T>
- Returns:
- true if this action is of type pass
isScout
public boolean isScout()
- Specified by:
isScout in interface LoggableAction<T>
- Returns:
- true if this action is of type scout
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object
- Returns:
- the string representation of the action; the type, the country,
the direction the units involved and the result.