Class TradingUtility
java.lang.Object
games.stendhal.server.maps.semos.tavern.market.TradingUtility
helper class for handling adding and prolonging offers
- Author:
- madmetzger
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic BigDecimal
calculateFee(Player player, int price)
calculates the trading fee a player has to pay when selling for a certain pricestatic boolean
canPlayerAffordTradingFee(Player player, int price)
checks if a player can afford the trading fee depending on pricestatic boolean
isPlayerWithinOfferLimit(Player player)
checks if a player has not already placed the max number of offersstatic boolean
substractTradingFee(Player player, int price)
substracts the trading fee from the player depending on the given price
-
Constructor Details
-
TradingUtility
public TradingUtility()
-
-
Method Details
-
substractTradingFee
substracts the trading fee from the player depending on the given price- Parameters:
player
-price
-- Returns:
- true iff player dropped the amount of money
-
canPlayerAffordTradingFee
checks if a player can afford the trading fee depending on price- Parameters:
player
-price
-- Returns:
- true iff player has enough money
-
calculateFee
calculates the trading fee a player has to pay when selling for a certain price- Parameters:
player
-price
-- Returns:
- the trading fee
-
isPlayerWithinOfferLimit
checks if a player has not already placed the max number of offers- Parameters:
player
-- Returns:
- true if the player is within the limit, false otherwise
-