Class OpponentsOrder
- java.lang.Object
-
- ch.sahits.game.openpatrician.model.event.TimedTask
-
- ch.sahits.game.openpatrician.display.event.task.OpponentsOrder
-
- All Implemented Interfaces:
java.lang.Runnable
public class OpponentsOrder extends TimedTask
Order of the opponent to attack the original client. The offer is postponed 10 days and will be canceled once the opponents ship is attacked. This task adds itself the the timed event list.- Author:
- Andi Hotz, (c) Sahits GmbH, 2013 Created on Feb 24, 2013
-
-
Field Summary
Fields Modifier and Type Field Description private IPlayerclientprivate com.google.common.eventbus.AsyncEventBusclientEventBusprivate com.google.common.eventbus.AsyncEventBusclientServerEventBusprivate Datedateprivate EventHandlerFactoryeventHandlerFactoryprivate TimedUpdatableTaskListlistprivate Localelocaleprivate org.springframework.context.MessageSourcemessageSourceprivate IPlayeropponentprivate TimedEventListenerorderprivate IPlayerplayerprivate intpremium
-
Constructor Summary
Constructors Constructor Description OpponentsOrder(IPlayer opponent, IPlayer client, IPlayer player, int premium)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidhandleShipAttack(ShipAttackEvent event)Handling ships attacks.private voidinitializeEventBus()voidrun()java.lang.StringtoString()
-
-
-
Field Detail
-
opponent
private final IPlayer opponent
-
client
private final IPlayer client
-
player
private final IPlayer player
-
premium
private final int premium
-
list
@Autowired private TimedUpdatableTaskList list
-
clientServerEventBus
@Autowired @Qualifier("serverClientEventBus") private com.google.common.eventbus.AsyncEventBus clientServerEventBus
-
clientEventBus
@Autowired @Qualifier("clientEventBus") private com.google.common.eventbus.AsyncEventBus clientEventBus
-
eventHandlerFactory
@Autowired private EventHandlerFactory eventHandlerFactory
-
date
@Autowired private Date date
-
locale
@Autowired private Locale locale
-
messageSource
@Autowired @Qualifier("messageSource") private org.springframework.context.MessageSource messageSource
-
order
private TimedEventListener order
-
-
Method Detail
-
initializeEventBus
@PostConstruct private void initializeEventBus()
-
run
public void run()
-
handleShipAttack
public void handleShipAttack(ShipAttackEvent event)
Handling ships attacks.- Parameters:
event- of a ship attack
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-