Package breitband.GUI.ui
Class CableStore
- java.lang.Object
-
- breitband.GUI.ui.CableStore
-
public class CableStore extends java.lang.Object
A vertical list of all cables that can be picked upThere are buttons for increasing or decreasing the amount of a certain cable type that will be picked up. Also, there is a button for confirming the purchase. It triggers the
onPurchase
event.- Author:
- Luna Otte
-
-
Constructor Summary
Constructors Constructor Description CableStore(sag.SAGPanel panel, java.util.Map<java.lang.String,CableConfig> cableTypes, int maxPrice)
Creates a new CableStore
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
hide()
Hides the store by pushing it offscreenCableStore
onPurchase(java.util.function.Consumer<java.util.HashMap<java.lang.String,java.lang.Integer>> action)
This action is performed when a purchase is madevoid
show()
Shows the store by pushing it onscreen
-
-
-
Constructor Detail
-
CableStore
public CableStore(sag.SAGPanel panel, java.util.Map<java.lang.String,CableConfig> cableTypes, int maxPrice)
Creates a new CableStore- Parameters:
panel
- The panel the CableStore will be attached tocableTypes
- All available cable typesmaxPrice
- The maximum amount that can be spent each round
-
-
Method Detail
-
show
public void show()
Shows the store by pushing it onscreen
-
hide
public void hide()
Hides the store by pushing it offscreen
-
onPurchase
public CableStore onPurchase(java.util.function.Consumer<java.util.HashMap<java.lang.String,java.lang.Integer>> action)
This action is performed when a purchase is made- Parameters:
action
- The action that will be taken on purchase- Returns:
- The CableStore (for chaining methods)
-
-