diff --git a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/merchant/MerchantPriceModel.java b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/merchant/MerchantPriceModel.java new file mode 100644 index 000000000..2e1ee97df --- /dev/null +++ b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/merchant/MerchantPriceModel.java @@ -0,0 +1,9 @@ +package com.gempukku.lotro.merchant; + +import java.util.Date; + +public interface MerchantPriceModel { + public int getCardSellPrice(int lastTransactionValue, Date lastTransactionTime, Date openingTime, Date currentTime); + + public int getCardBuyPrice(int lastTransactionValue, Date lastTransactionTime, Date openingTime, Date currentTime); +} diff --git a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/merchant/ParameterMerchantPriceModel.java b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/merchant/ParameterMerchantPriceModel.java new file mode 100644 index 000000000..a8f49d4bc --- /dev/null +++ b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/merchant/ParameterMerchantPriceModel.java @@ -0,0 +1,21 @@ +package com.gempukku.lotro.merchant; + +import java.util.Date; + +public class ParameterMerchantPriceModel implements MerchantPriceModel { + private static final int DAY = 24 * 60 * 60 * 1000; + private float _profitMargin = 0.7f; + private long _priceRevertTime = 5 * DAY; + private long _easingTime = 30 * DAY; + + @Override + public int getCardBuyPrice(int lastTransactionValue, Date lastTransactionTime, Date openingTime, Date currentTime) { + return (int) Math.floor(_profitMargin + * getCardSellPrice(lastTransactionValue, lastTransactionTime, openingTime, currentTime)); + } + + @Override + public int getCardSellPrice(int lastTransactionValue, Date lastTransactionTime, Date openingTime, Date currentTime) { + return lastTransactionValue / (1 + ()); + } +}