game.events
Class AbstractEvent

java.lang.Object
  |
  +--game.events.AbstractEvent
All Implemented Interfaces:
Event
Direct Known Subclasses:
AbstractCivilizationEvent, AbstractCompoundEvent, AbstractSquareEvent, BuildUnitEvent, CivilizationSizeEvent, ConditionEvent, DefunctEvent, DestroyArmiesEvent, LoadSettlersEvent, PopulationEvent, TechnologyEvent, TurnEvent, YearEvent, ZeroPopulationEvent

public abstract class AbstractEvent
extends java.lang.Object
implements Event

Abstract base class for events. Holds the list of events.


Constructor Summary
AbstractEvent()
          Constructor.
 
Method Summary
 void activate()
          Set the event to active.
 void addActivateEvent(ActivateEvent value)
          Add an activate event action.
 void addBulletin(BulletinAction value)
          Add a bulletin action.
 void addDisplay(DisplayAction value)
          Add a display action.
 void addEnableTechnology(EnableTechnologyAction value)
          Add an enable technology action.
 void addEventAction(EventAction value)
          Add an event action.
 void addGiveResearch(IssueResearchPointsAction value)
          Add a issue research points action.
 void addRemoveEvent(RemoveEvent value)
          Add a remove event action.
 void addRemoveFeature(RemoveFeature value)
          Add a remove feature from square action.
 void addSaveCondition(SaveCondition value)
          Add a save condition action.
 void addSaveCondition(java.lang.String value)
          Add a save condition action.
 void addUnits(CreateUnitAction value)
          Add a create units action.
 void autocenter()
          Autocenter the view.
 void cancel()
          Cancel this event.
 int getAfterTurn()
          Return the time the event is to be inactive for.
 Civilization getCivilization()
          Get the civilization involved.
 java.lang.String getCivilizationName()
          Get the name of the civilization involved.
 java.lang.String getName()
          Get name.
 boolean getNegative()
          Get negative, negative reverses the firing condition for the event.
 boolean isCancelled()
          Return true if the cancel condition is met.
 boolean isCurrent()
          Return true if the cancel condition is met.
 void performActions()
          Perform all the actions associated with this event.
 void setAfter(int value)
          Set the time the event is to be inactive for.
 void setCancelCondition(java.lang.String value)
          Set cancel condition.
 void setCancelTurn(int value)
          Set cancel turn.
 void setCenterView(Location value)
           
 void setCenterView(java.lang.String value)
           
 void setCivilization(java.lang.String value)
          Set the name of the civilization involved.
 void setInactive(java.lang.Boolean dummy)
          Set the active flag off at the start.
 void setName(java.lang.String value)
          Set the name.
 void setNegative(java.lang.Boolean dummy)
          Set negative.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface game.events.Event
hasOccurred
 

Constructor Detail

AbstractEvent

public AbstractEvent()
Constructor.

Method Detail

getName

public java.lang.String getName()
Get name.

Specified by:
getName in interface Event
Returns:
name, if any.

setName

public void setName(java.lang.String value)
Set the name.


activate

public void activate()
Set the event to active.

Specified by:
activate in interface Event

setInactive

public void setInactive(java.lang.Boolean dummy)
Set the active flag off at the start.


setNegative

public void setNegative(java.lang.Boolean dummy)
Set negative.


getNegative

public boolean getNegative()
Get negative, negative reverses the firing condition for the event.

Specified by:
getNegative in interface Event
Returns:
true if the event is fired if the condition is not met.

performActions

public void performActions()
Perform all the actions associated with this event.

Specified by:
performActions in interface Event

getCivilization

public Civilization getCivilization()
Get the civilization involved.

Specified by:
getCivilization in interface Event

getCivilizationName

public java.lang.String getCivilizationName()
Get the name of the civilization involved.


setCivilization

public void setCivilization(java.lang.String value)
Set the name of the civilization involved.

Parameters:
value - the name of the civilization invovled.

setAfter

public void setAfter(int value)
Set the time the event is to be inactive for.

Specified by:
setAfter in interface Event
Parameters:
value - the time the event is to be inactive for.

getAfterTurn

public int getAfterTurn()
Return the time the event is to be inactive for.

Returns:
the time the event is to be inactive for.

setCancelCondition

public void setCancelCondition(java.lang.String value)
Set cancel condition.

Parameters:
value - cancel condition name.

setCancelTurn

public void setCancelTurn(int value)
Set cancel turn.

Parameters:
value - cancel turn.

setCenterView

public void setCenterView(Location value)

setCenterView

public void setCenterView(java.lang.String value)

autocenter

public void autocenter()
Description copied from interface: Event
Autocenter the view.

Specified by:
autocenter in interface Event

isCurrent

public boolean isCurrent()
Return true if the cancel condition is met.

Specified by:
isCurrent in interface Event

cancel

public void cancel()
Cancel this event.

Specified by:
cancel in interface Event

isCancelled

public boolean isCancelled()
Return true if the cancel condition is met.

Specified by:
isCancelled in interface Event

addRemoveFeature

public void addRemoveFeature(RemoveFeature value)
Add a remove feature from square action.

Parameters:
value - the remove feature action to add.

addDisplay

public void addDisplay(DisplayAction value)
Add a display action.

Parameters:
value - the display action to add.

addSaveCondition

public void addSaveCondition(SaveCondition value)
Add a save condition action.

Parameters:
value - the save condition action to add.

addSaveCondition

public void addSaveCondition(java.lang.String value)
Add a save condition action.

Parameters:
value - the named condition action to add.

addBulletin

public void addBulletin(BulletinAction value)
Add a bulletin action.

Parameters:
value - the bulletin action to add.

addUnits

public void addUnits(CreateUnitAction value)
Add a create units action.

Parameters:
value - the create units action to add.

addEnableTechnology

public void addEnableTechnology(EnableTechnologyAction value)
Add an enable technology action.

Parameters:
value - the enable technology action to add.

addGiveResearch

public void addGiveResearch(IssueResearchPointsAction value)
Add a issue research points action.

Parameters:
value - the issue research points action to add.

addEventAction

public void addEventAction(EventAction value)
Add an event action.

Parameters:
value - the event action to add.

addRemoveEvent

public void addRemoveEvent(RemoveEvent value)
Add a remove event action.


addActivateEvent

public void addActivateEvent(ActivateEvent value)
Add an activate event action.