toroidwars.logging
Class AbstractLoggableAction<T>

java.lang.Object
  extended by 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

Constructor Summary
protected AbstractLoggableAction(Country country, Direction direction, int numberOfUnits, T result)
           
 
Method Summary
 Country getCountry()
           
 Direction getDirection()
           
 int getNumberOfUnits()
           
 T getResult()
           
 boolean isAttack()
           
 boolean isAttacked()
           
 boolean isBuild()
           
 boolean isConquered()
           
 boolean isPass()
           
 boolean isScout()
           
 boolean isTransfer()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractLoggableAction

protected AbstractLoggableAction(Country country,
                                 Direction direction,
                                 int numberOfUnits,
                                 T result)
Parameters:
country - the logging action relates to
direction - direction the action is taken
numberOfUnits - units involved
result - the result that was returned
Method Detail

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.