package utils; import edu.neu.ccs.demeterf.demfgen.lib.List; import gen.Derivative; import gen.Player; /** Class for traversing * @author animesh * */ public class PriceReducer extends ListTUCombiner{ Player player; double decrement; public PriceReducer(Player player, double decrement) { super(); this.player = player; this.decrement = decrement; } List combine(Derivative der){ der.seller = player.id; if(der.price.val > this.decrement) der.price.val-=this.decrement; else der.price.val = 0.0; return List.create(der); } }