// Path: src/main/java/edu/self/startux/craftBay/event/AuctionBidEvent.java
// public class AuctionBidEvent extends AuctionEvent {
//         private static HandlerList handlers = new HandlerList();
//         private Merchant bidder, oldWinner;
//         private MoneyAmount amount, oldPrice;
// 
//         public AuctionBidEvent(Auction auction, Merchant bidder, MoneyAmount amount, Merchant oldWinner, MoneyAmount oldPrice) {
//                 super(auction);
//                 this.bidder = bidder;
//                 this.amount = amount;
//                 this.oldWinner = oldWinner;
//                 this.oldPrice = oldPrice;
//         }
// 
//         public static HandlerList getHandlerList() {
//                 return handlers;
//         }
// 
//         @Override
//         public HandlerList getHandlers() {
//                 return handlers;
//         }
// 
//         public Merchant getBidder() {
//                 return bidder;
//         }
// 
//         public MoneyAmount getAmount() {
//                 return amount;
//         }
// 
//         public Merchant getOldWinner() {
//                 return oldWinner;
//         }
// 
//         public MoneyAmount getOldPrice() {
//                 return oldPrice;
//         }
// }
// 
// Path: src/main/java/edu/self/startux/craftBay/event/AuctionStartEvent.java
// public class AuctionStartEvent extends AuctionEvent {
//         private static HandlerList handlers = new HandlerList();
// 
//         public AuctionStartEvent(Auction auction) {
//                 super(auction);
//         }
// 
//         public static HandlerList getHandlerList() {
//                 return handlers;
//         }
// 
//         @Override
//         public HandlerList getHandlers() {
//                 return handlers;
//         }
// }
// 
// Path: src/main/java/edu/self/startux/craftBay/event/AuctionTickEvent.java
// public class AuctionTickEvent extends AuctionEvent {
//         private static HandlerList handlers = new HandlerList();
// 
//         public AuctionTickEvent(Auction auction) {
//                 super(auction);
//         }
// 
//         public static HandlerList getHandlerList() {
//                 return handlers;
//         }
// 
//         @Override
//         public HandlerList getHandlers() {
//                 return handlers;
//         }
// }


import edu.self.startux.craftBay.event.AuctionBidEvent;
import edu.self.startux.craftBay.event.AuctionStartEvent;
import edu.self.startux.craftBay.event.AuctionTickEvent;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;
import java.util.Map;
import java.util.UUID;
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * Copyright 2012 StarTux
 *
 * This file is part of CraftBay.
 *
 * CraftBay is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * CraftBay is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with CraftBay.  If not, see <http://www.gnu.org/licenses/>.
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

package edu.self.startux.craftBay;


public class TimedAuction extends AbstractAuction {
    private int timeLeft;
    private double minbid;
    private double minIncrement = 5.0;
    private double minRaise = 0.05;
    private LinkedList<Bid> bids = new LinkedList<Bid>();
    private UUID lastBidder = null;

    public TimedAuction(CraftBayPlugin plugin, Merchant owner, Item item) {
        super(plugin, owner, item);
        minbid = plugin.getConfig().getDouble("startingbid");
        timeLeft = plugin.getConfig().getInt("auctiontime");
        minIncrement = plugin.getConfig().getDouble("minincrement", minIncrement);
        minRaise = plugin.getConfig().getDouble("minraise", minRaise);
        
    }

    @Override
    public void start() {
        scheduleTick(true);
        setState(AuctionState.RUNNING);
// Path: src/main/java/edu/self/startux/craftBay/event/AuctionBidEvent.java
// public class AuctionBidEvent extends AuctionEvent {
//         private static HandlerList handlers = new HandlerList();
//         private Merchant bidder, oldWinner;
//         private MoneyAmount amount, oldPrice;
// 
//         public AuctionBidEvent(Auction auction, Merchant bidder, MoneyAmount amount, Merchant oldWinner, MoneyAmount oldPrice) {
//                 super(auction);
//                 this.bidder = bidder;
//                 this.amount = amount;
//                 this.oldWinner = oldWinner;
//                 this.oldPrice = oldPrice;
//         }
// 
//         public static HandlerList getHandlerList() {
//                 return handlers;
//         }
// 
//         @Override
//         public HandlerList getHandlers() {
//                 return handlers;
//         }
// 
//         public Merchant getBidder() {
//                 return bidder;
//         }
// 
//         public MoneyAmount getAmount() {
//                 return amount;
//         }
// 
//         public Merchant getOldWinner() {
//                 return oldWinner;
//         }
// 
//         public MoneyAmount getOldPrice() {
//                 return oldPrice;
//         }
// }
// 
// Path: src/main/java/edu/self/startux/craftBay/event/AuctionStartEvent.java
// public class AuctionStartEvent extends AuctionEvent {
//         private static HandlerList handlers = new HandlerList();
// 
//         public AuctionStartEvent(Auction auction) {
//                 super(auction);
//         }
// 
//         public static HandlerList getHandlerList() {
//                 return handlers;
//         }
// 
//         @Override
//         public HandlerList getHandlers() {
//                 return handlers;
//         }
// }
// 
// Path: src/main/java/edu/self/startux/craftBay/event/AuctionTickEvent.java
// public class AuctionTickEvent extends AuctionEvent {
//         private static HandlerList handlers = new HandlerList();
// 
//         public AuctionTickEvent(Auction auction) {
//                 super(auction);
//         }
// 
//         public static HandlerList getHandlerList() {
//                 return handlers;
//         }
// 
//         @Override
//         public HandlerList getHandlers() {
//                 return handlers;
//         }
// }


// Path: src/main/java/edu/self/startux/craftBay/TimedAuction.java
import edu.self.startux.craftBay.event.AuctionBidEvent;
import edu.self.startux.craftBay.event.AuctionStartEvent;
import edu.self.startux.craftBay.event.AuctionTickEvent;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;
import java.util.Map;
import java.util.UUID;

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * Copyright 2012 StarTux
 *
 * This file is part of CraftBay.
 *
 * CraftBay is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * CraftBay is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with CraftBay.  If not, see <http://www.gnu.org/licenses/>.
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

package edu.self.startux.craftBay;


public class TimedAuction extends AbstractAuction {
    private int timeLeft;
    private double minbid;
    private double minIncrement = 5.0;
    private double minRaise = 0.05;
    private LinkedList<Bid> bids = new LinkedList<Bid>();
    private UUID lastBidder = null;

    public TimedAuction(CraftBayPlugin plugin, Merchant owner, Item item) {
        super(plugin, owner, item);
        minbid = plugin.getConfig().getDouble("startingbid");
        timeLeft = plugin.getConfig().getInt("auctiontime");
        minIncrement = plugin.getConfig().getDouble("minincrement", minIncrement);
        minRaise = plugin.getConfig().getDouble("minraise", minRaise);
        
    }

    @Override
    public void start() {
        scheduleTick(true);
        setState(AuctionState.RUNNING);
        AuctionStartEvent event = new AuctionStartEvent(this);