Class StockMarketService
- java.lang.Object
-
- org.rspeer.game.service.stockmarket.StockMarketService
-
-
Constructor Summary
Constructors Constructor Description StockMarketService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Queue<StockMarketEntry>
getBuying()
Queue<StockMarketEntry>
getCancel()
BiConsumer<StockMarketEntry,Integer>
getCancelConsumer()
StockMarketEntry
getNextBuyOffer()
StockMarketEntry
getNextSellOffer()
Queue<StockMarketEntry>
getSelling()
Queue<StockMarketEntry>
getWaiting()
boolean
isAttentionRequired()
boolean
isWaiting()
void
notify(StockMarketEvent event)
void
onUnsubscribe()
void
setCancelConsumer(BiConsumer<StockMarketEntry,Integer> cancelConsumer)
void
submit(StockMarketable.Type type, ItemEntry entry)
void
submit(StockMarketable.Type type, StockMarketEntry entry)
Submits an offer to buy or sell.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.rspeer.event.Service
onSubscribe
-
-
-
-
Method Detail
-
submit
public void submit(StockMarketable.Type type, StockMarketEntry entry)
Submits an offer to buy or sell. Doing so will enable isAttentionRequired and thus should trigger restock tasks.
-
submit
public void submit(StockMarketable.Type type, ItemEntry entry)
-
isWaiting
public boolean isWaiting()
- Returns:
- true if offers are in progress
-
getWaiting
public Queue<StockMarketEntry> getWaiting()
-
getCancel
public Queue<StockMarketEntry> getCancel()
-
getSelling
public Queue<StockMarketEntry> getSelling()
-
getBuying
public Queue<StockMarketEntry> getBuying()
-
isAttentionRequired
public boolean isAttentionRequired()
- Returns:
- true if the player has tasks to do at the g/e
-
getNextBuyOffer
public StockMarketEntry getNextBuyOffer()
-
getNextSellOffer
public StockMarketEntry getNextSellOffer()
-
notify
public void notify(StockMarketEvent event)
-
onUnsubscribe
public void onUnsubscribe()
- Specified by:
onUnsubscribe
in interfaceService
-
getCancelConsumer
public BiConsumer<StockMarketEntry,Integer> getCancelConsumer()
-
setCancelConsumer
public void setCancelConsumer(BiConsumer<StockMarketEntry,Integer> cancelConsumer)
-
-