package com.demez.module;

import java.awt.Color;

import com.demez.ui.DraggableComponent;

import net.minecraft.client.Minecraft;

public class Module {
	public static Minecraft mc = Minecraft.getMinecraft();
	private String name;
	private int key;
	private boolean toggled;
	private int x;
	private int y;
	public DraggableComponent drag;

	
	public Module(String name, int key , int x, int y)
	{
		this.name = name;
		this.key = key;
		this.toggled = false;
		this.x = x;
		this.y = y;
		
		drag = new DraggableComponent(x, y, getWidth(), getHeight(), 0x000000);

	}
	
	public void onEnable()
	{
		
	}
	
	public void onDisable()
	{
		
	}
	
	public void onUpdate()
	{
		
	}
	
	public void onRender()
	{
		
	}
	
	public void toggle()
	{
		toggled = !toggled;
		if (toggled)
		{
			onEnable();
		}else
		{
			onDisable();
		}
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getKey() {
		return key;
	}

	public void setKey(int key) {
		this.key = key;
	}

	public boolean isToggled() {
		return toggled;
	}

	public void setToggled(boolean toggled) {
		this.toggled = toggled;
	}
	
	public int getHeight() {
		return 50;

	}

	public int getWidth() {
		return 50;

	}

	public static Minecraft getMc() {
		return mc;
	}

	public static void setMc(Minecraft mc) {
		Module.mc = mc;
	}

	

	public void setX(int x) {
		this.x = x;
	}

	public int getX() {
		return drag.getxPosition();
	}

	public int getY() {
		return drag.getyPosition();
	}
	
	public void renderDummy(int mouseX, int mouseY) {
		drag.draw(mouseX, mouseY);
	}
	
	
}
