package com.gamingmesh.jobs.container; import java.util.HashMap; import com.gamingmesh.jobs.stuff.TimeManage; public final class Log { private String action; private int day; private HashMap amountMap = new HashMap(); public Log(String action) { this.action = action; setDate(); } public String getActionType() { return this.action; } public void add(String item, double money, double exp) { if (!this.amountMap.containsKey(item)) { LogAmounts LAmount = new LogAmounts(item); LAmount.addCount(); LAmount.addMoney(money); LAmount.addExp(exp); this.amountMap.put(item, LAmount); } else { LogAmounts LAmount = this.amountMap.get(item); LAmount.addCount(); LAmount.addMoney(money); LAmount.addExp(exp); this.amountMap.put(item, LAmount); } } public void add(String item, int count, double money, double exp) { if (!this.amountMap.containsKey(item)) { LogAmounts LAmount = new LogAmounts(item); LAmount.setCount(count); LAmount.setNewEntry(false); LAmount.addMoney(money); LAmount.addExp(exp); this.amountMap.put(item, LAmount); } else { LogAmounts LAmount = this.amountMap.get(item); LAmount.setCount(count); LAmount.setNewEntry(false); LAmount.addMoney(money); LAmount.addExp(exp); this.amountMap.put(item, LAmount); } } public void setDate() { this.day = TimeManage.timeInInt(); } public int getDate() { return this.day; } public HashMap getAmountList() { return this.amountMap; } public int getCount(String item) { if (this.amountMap.containsKey(item)) return this.amountMap.get(item).getCount(); else return 0; } public double getMoney(String item) { if (this.amountMap.containsKey(item)) return this.amountMap.get(item).getMoney(); else return 0; } public double getExp(String item) { if (this.amountMap.containsKey(item)) return this.amountMap.get(item).getExp(); else return 0; } }