Package breitband.GUI.ui
Class PlayerInfo
- java.lang.Object
-
- breitband.GUI.ui.PlayerInfo
-
public class PlayerInfo extends java.lang.Object
Displays info about the player;- Their contracts
- Their inventory state
- Author:
- Luna Otte
-
-
Constructor Summary
Constructors Constructor Description PlayerInfo(sag.SAGPanel panel, java.util.Collection<CableConfig> cableConfig)
Builds a new info layer into the panel
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addContract(Contract contract)
Adds a contract to the contract listPlayerInfo
onEnterContract(java.util.function.Consumer<Contract> action)
This event is triggered when a user's cursor enters a contract from the contract listPlayerInfo
onExitContract(java.util.function.Consumer<Contract> action)
This event is triggered when a user's cursor leaves a contract from the contract listvoid
setCableAmounts(java.util.HashMap<java.lang.String,java.lang.Integer> amounts)
Sets the amount of cables that are shown in the inventoryvoid
setContracts(java.util.Collection<Contract> contracts)
Sets the contracts of the contract list
-
-
-
Constructor Detail
-
PlayerInfo
public PlayerInfo(sag.SAGPanel panel, java.util.Collection<CableConfig> cableConfig)
Builds a new info layer into the panel- Parameters:
panel
- The panel that the info layer is added tocableConfig
- The cable configuration
-
-
Method Detail
-
setContracts
public void setContracts(java.util.Collection<Contract> contracts)
Sets the contracts of the contract list- Parameters:
contracts
- The contracts
-
addContract
public void addContract(Contract contract)
Adds a contract to the contract list- Parameters:
contract
- The new contract
-
setCableAmounts
public void setCableAmounts(java.util.HashMap<java.lang.String,java.lang.Integer> amounts)
Sets the amount of cables that are shown in the inventory- Parameters:
amounts
- The new amounts of cables
-
onEnterContract
public PlayerInfo onEnterContract(java.util.function.Consumer<Contract> action)
This event is triggered when a user's cursor enters a contract from the contract list- Parameters:
action
- The action that will be taken when the mouse enters- Returns:
- The PlayerInfo (for chaining methods)
-
onExitContract
public PlayerInfo onExitContract(java.util.function.Consumer<Contract> action)
This event is triggered when a user's cursor leaves a contract from the contract list- Parameters:
action
- The action that will be taken when the mouse leaves- Returns:
- The PlayerInfo (for chaining methods)
-
-