package org.yggard.brokkgui.wrapper.event;

import org.yggard.brokkgui.wrapper.container.BrokkGuiContainer;
import org.yggard.hermod.EventType;
import org.yggard.hermod.HermodEvent;

import net.minecraft.inventory.Slot;

/**
 * @author Ourten 31 oct. 2016
 */
public class SlotEvent extends HermodEvent
{
    public static final EventType<SlotEvent>       ANY   = new EventType<>("SLOT_EVENT");
    public static final EventType<SlotEvent.Click> CLICK = new EventType<>(SlotEvent.ANY, "SLOT_CLICK_EVENT");

    private final Slot                             slot;

    public SlotEvent(final BrokkGuiContainer<?> source, final Slot slot)
    {
        super(source);

        this.slot = slot;
    }

    public Slot getSlot()
    {
        return this.slot;
    }

    public static final class Click extends SlotEvent
    {
        private final int key;

        public Click(final BrokkGuiContainer<?> source, final Slot slot, final int key)
        {
            super(source, slot);

            this.key = key;
        }

        public int getKey()
        {
            return this.key;
        }
    }
}
@@ -355,16 +355,17 @@
   ANY   
+ 
 = new Ev
@@ -446,16 +446,17 @@
 %3E CLICK 
+ 
 = new Ev
@@ -500,16 +500,129 @@
 EVENT%22);
+%0A    public static final EventType%3CChange%3E          CHANGE = new EventType%3C%3E(SlotEvent.ANY, %22SLOT_CHANGE_EVENT%22);
 %0A%0A    pr
@@ -1219,10 +1219,205 @@
  %7D%0A    %7D
+%0A%0A    public static final class Change extends SlotEvent%0A    %7B%0A        public Change(final BrokkGuiContainer%3C?%3E source, final Slot slot)%0A        %7B%0A            super(source, slot);%0A        %7D%0A    %7D
 %0A%7D

Add a slot change event