// 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/AuctionCancelEvent.java
// public class AuctionCancelEvent extends AuctionEvent {
//         private static HandlerList handlers = new HandlerList();
//         private CommandSender sender;
// 
//         public AuctionCancelEvent(Auction auction, CommandSender sender) {
//                 super(auction);
//                 this.sender = sender;
//         }
// 
//         public static HandlerList getHandlerList() {
//                 return handlers;
//         }
// 
//         @Override
//         public HandlerList getHandlers() {
//                 return handlers;
//         }
// 
//         public CommandSender getSender() {
//                 return sender;
//         }
// }
// 
// Path: src/main/java/edu/self/startux/craftBay/event/AuctionCreateEvent.java
// public class AuctionCreateEvent extends AuctionEvent {
//         private static HandlerList handlers = new HandlerList();
// 
//         public AuctionCreateEvent(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/AuctionEndEvent.java
// public class AuctionEndEvent extends AuctionEvent {
//         private static HandlerList handlers = new HandlerList();
//         private boolean paymentError = false;
// 
//         public AuctionEndEvent(Auction auction) {
//                 super(auction);
//         }
// 
//         public static HandlerList getHandlerList() {
//                 return handlers;
//         }
// 
//         @Override
//         public HandlerList getHandlers() {
//                 return handlers;
//         }
// 
//         public void setPaymentError(boolean paymentError) {
//                 this.paymentError = paymentError;
//         }
// 
//         public boolean hasPaymentError() {
//                 return paymentError;
//         }
// }
// 
// 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/AuctionTimeChangeEvent.java
// public class AuctionTimeChangeEvent extends AuctionEvent {
//         private static HandlerList handlers = new HandlerList();
//         private CommandSender sender;
//         private int delay;
// 
//         public AuctionTimeChangeEvent(Auction auction, CommandSender sender, int delay) {
//                 super(auction);
//                 this.sender = sender;
//                 this.delay = delay;
//         }
// 
//         public static HandlerList getHandlerList() {
//                 return handlers;
//         }
// 
//         @Override
//         public HandlerList getHandlers() {
//                 return handlers;
//         }
// 
//         public CommandSender getSender() {
//                 return sender;
//         }
// 
//         public int getDelay() {
//                 return delay;
//         }
// }


import edu.self.startux.craftBay.event.AuctionBidEvent;
import edu.self.startux.craftBay.event.AuctionCancelEvent;
import edu.self.startux.craftBay.event.AuctionCreateEvent;
import edu.self.startux.craftBay.event.AuctionEndEvent;
import edu.self.startux.craftBay.event.AuctionStartEvent;
import edu.self.startux.craftBay.event.AuctionTimeChangeEvent;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * 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 AuctionLogger implements Listener {
        private CraftBayPlugin plugin;

        public AuctionLogger(CraftBayPlugin plugin) {
                this.plugin = plugin;
        }

        public void enable() {
                plugin.getServer().getPluginManager().registerEvents(this, plugin);
        }

        @EventHandler(priority = EventPriority.LOWEST)
        public void onAuctionCreate(AuctionCreateEvent event) {
                if (!plugin.getDebugMode()) return;
                Auction auction = event.getAuction();
// 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/AuctionCancelEvent.java
// public class AuctionCancelEvent extends AuctionEvent {
//         private static HandlerList handlers = new HandlerList();
//         private CommandSender sender;
// 
//         public AuctionCancelEvent(Auction auction, CommandSender sender) {
//                 super(auction);
//                 this.sender = sender;
//         }
// 
//         public static HandlerList getHandlerList() {
//                 return handlers;
//         }
// 
//         @Override
//         public HandlerList getHandlers() {
//                 return handlers;
//         }
// 
//         public CommandSender getSender() {
//                 return sender;
//         }
// }
// 
// Path: src/main/java/edu/self/startux/craftBay/event/AuctionCreateEvent.java
// public class AuctionCreateEvent extends AuctionEvent {
//         private static HandlerList handlers = new HandlerList();
// 
//         public AuctionCreateEvent(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/AuctionEndEvent.java
// public class AuctionEndEvent extends AuctionEvent {
//         private static HandlerList handlers = new HandlerList();
//         private boolean paymentError = false;
// 
//         public AuctionEndEvent(Auction auction) {
//                 super(auction);
//         }
// 
//         public static HandlerList getHandlerList() {
//                 return handlers;
//         }
// 
//         @Override
//         public HandlerList getHandlers() {
//                 return handlers;
//         }
// 
//         public void setPaymentError(boolean paymentError) {
//                 this.paymentError = paymentError;
//         }
// 
//         public boolean hasPaymentError() {
//                 return paymentError;
//         }
// }
// 
// 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/AuctionTimeChangeEvent.java
// public class AuctionTimeChangeEvent extends AuctionEvent {
//         private static HandlerList handlers = new HandlerList();
//         private CommandSender sender;
//         private int delay;
// 
//         public AuctionTimeChangeEvent(Auction auction, CommandSender sender, int delay) {
//                 super(auction);
//                 this.sender = sender;
//                 this.delay = delay;
//         }
// 
//         public static HandlerList getHandlerList() {
//                 return handlers;
//         }
// 
//         @Override
//         public HandlerList getHandlers() {
//                 return handlers;
//         }
// 
//         public CommandSender getSender() {
//                 return sender;
//         }
// 
//         public int getDelay() {
//                 return delay;
//         }
// }


// Path: src/main/java/edu/self/startux/craftBay/AuctionLogger.java
import edu.self.startux.craftBay.event.AuctionBidEvent;
import edu.self.startux.craftBay.event.AuctionCancelEvent;
import edu.self.startux.craftBay.event.AuctionCreateEvent;
import edu.self.startux.craftBay.event.AuctionEndEvent;
import edu.self.startux.craftBay.event.AuctionStartEvent;
import edu.self.startux.craftBay.event.AuctionTimeChangeEvent;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * 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 AuctionLogger implements Listener {
        private CraftBayPlugin plugin;

        public AuctionLogger(CraftBayPlugin plugin) {
                this.plugin = plugin;
        }

        public void enable() {
                plugin.getServer().getPluginManager().registerEvents(this, plugin);
        }

        @EventHandler(priority = EventPriority.LOWEST)
        public void onAuctionCreate(AuctionCreateEvent event) {
                if (!plugin.getDebugMode()) return;
                Auction auction = event.getAuction();
                auction.log(String.format("CREATE owner='%s' item='%s' minbid='%s' fee='%s'", auction.getOwner().getName(), auction.getItem().toString(), auction.getMinimalBid(), auction.getFee()));