// Path: src/main/java/cn/academy/energy/api/block/IWirelessNode.java
// public interface IWirelessNode extends IWirelessTile {
// 
//     double getMaxEnergy();
// 
//     double getEnergy();
// 
//     void setEnergy(double value);
// 
//     /**
//      * @return How many energy that this node can transfer each tick.
//      */
//     double getBandwidth();
// 
//     int getCapacity();
// 
//     /**
//      * @return How far this node's signal can reach.
//      */
//     double getRange();
// 
//     /**
//      * @return the user custom name of the node
//      */
//     String getNodeName();
// 
// }
// 
// Path: src/main/java/cn/academy/energy/api/block/IWirelessTile.java
// public interface IWirelessTile {
// 
// }
// 
// Path: src/main/java/cn/academy/energy/api/event/WirelessUserEvent.java
// public class WirelessUserEvent extends WirelessEvent {
// 
//     public final UserType type;
// 
//     public WirelessUserEvent(IWirelessTile _tile) {
//         super(_tile);
//         if (_tile instanceof IWirelessGenerator) {
//             type = UserType.GENERATOR;
//         } else if (_tile instanceof IWirelessReceiver) {
//             type = UserType.RECEIVER;
//         } else {
//             throw new RuntimeException("Invalid user type");
//         }
//     }
// 
//     public IWirelessGenerator getAsGenerator() {
//         return (IWirelessGenerator) tile;
//     }
// 
//     public IWirelessReceiver getAsReceiver() {
//         return (IWirelessReceiver) tile;
//     }
// 
//     public enum UserType {GENERATOR, RECEIVER}
// 
// }


import cn.academy.energy.api.event.WirelessUserEvent;
import net.minecraftforge.fml.common.eventhandler.Cancelable;
import cn.academy.energy.api.block.IWirelessNode;
import cn.academy.energy.api.block.IWirelessTile;
/**
 * Copyright (c) Lambda Innovation, 2013-2015
 * 鏈綔鍝佺増鏉冪敱Lambda Innovation鎵�鏈夈��
 * http://www.li-dev.cn/
 * <p/>
 * This project is open-source, and it is distributed under
 * the terms of GNU General Public License. You can modify
 * and distribute freely as long as you follow the license.
 * 鏈」鐩槸涓�涓紑婧愰」鐩紝涓旈伒寰狦NU閫氱敤鍏叡鎺堟潈鍗忚銆�
 * 鍦ㄩ伒鐓ц鍗忚鐨勬儏鍐典笅锛屾偍鍙互鑷敱浼犳挱鍜屼慨鏀广��
 * http://www.gnu.org/licenses/gpl.html
 */
package cn.academy.energy.api.event.node;


/**
 * Fired whenever a wireless user(receiver or generator) is to be linked to a node.
 * Canceled if not correctly linked.
 * @author WeathFolD
 */
@Cancelable
public class LinkUserEvent extends WirelessUserEvent {

    public final IWirelessNode node;

    public LinkUserEvent(IWirelessTile _tile, IWirelessNode _node) {
        super(_tile);
// Path: src/main/java/cn/academy/energy/api/block/IWirelessNode.java
// public interface IWirelessNode extends IWirelessTile {
// 
//     double getMaxEnergy();
// 
//     double getEnergy();
// 
//     void setEnergy(double value);
// 
//     /**
//      * @return How many energy that this node can transfer each tick.
//      */
//     double getBandwidth();
// 
//     int getCapacity();
// 
//     /**
//      * @return How far this node's signal can reach.
//      */
//     double getRange();
// 
//     /**
//      * @return the user custom name of the node
//      */
//     String getNodeName();
// 
// }
// 
// Path: src/main/java/cn/academy/energy/api/block/IWirelessTile.java
// public interface IWirelessTile {
// 
// }
// 
// Path: src/main/java/cn/academy/energy/api/event/WirelessUserEvent.java
// public class WirelessUserEvent extends WirelessEvent {
// 
//     public final UserType type;
// 
//     public WirelessUserEvent(IWirelessTile _tile) {
//         super(_tile);
//         if (_tile instanceof IWirelessGenerator) {
//             type = UserType.GENERATOR;
//         } else if (_tile instanceof IWirelessReceiver) {
//             type = UserType.RECEIVER;
//         } else {
//             throw new RuntimeException("Invalid user type");
//         }
//     }
// 
//     public IWirelessGenerator getAsGenerator() {
//         return (IWirelessGenerator) tile;
//     }
// 
//     public IWirelessReceiver getAsReceiver() {
//         return (IWirelessReceiver) tile;
//     }
// 
//     public enum UserType {GENERATOR, RECEIVER}
// 
// }


// Path: src/main/java/cn/academy/energy/api/event/node/LinkUserEvent.java
import cn.academy.energy.api.event.WirelessUserEvent;
import net.minecraftforge.fml.common.eventhandler.Cancelable;
import cn.academy.energy.api.block.IWirelessNode;
import cn.academy.energy.api.block.IWirelessTile;

/**
 * Copyright (c) Lambda Innovation, 2013-2015
 * 鏈綔鍝佺増鏉冪敱Lambda Innovation鎵�鏈夈��
 * http://www.li-dev.cn/
 * <p/>
 * This project is open-source, and it is distributed under
 * the terms of GNU General Public License. You can modify
 * and distribute freely as long as you follow the license.
 * 鏈」鐩槸涓�涓紑婧愰」鐩紝涓旈伒寰狦NU閫氱敤鍏叡鎺堟潈鍗忚銆�
 * 鍦ㄩ伒鐓ц鍗忚鐨勬儏鍐典笅锛屾偍鍙互鑷敱浼犳挱鍜屼慨鏀广��
 * http://www.gnu.org/licenses/gpl.html
 */
package cn.academy.energy.api.event.node;


/**
 * Fired whenever a wireless user(receiver or generator) is to be linked to a node.
 * Canceled if not correctly linked.
 * @author WeathFolD
 */
@Cancelable
public class LinkUserEvent extends WirelessUserEvent {

    public final IWirelessNode node;

    public LinkUserEvent(IWirelessTile _tile, IWirelessNode _node) {
        super(_tile);
        node = _node;