| package li.cil.oc.api.detail; |
| |
| import li.cil.oc.api.driver.Block; |
| import li.cil.oc.api.driver.Converter; |
| import li.cil.oc.api.driver.Item; |
| |
| public interface DriverAPI { |
| /** |
| * Registers a new driver for a block component. |
| * <p/> |
| * Whenever the neighboring blocks of an Adapter block change, it checks if |
| * there exists a driver for the changed block, and if it is configured to |
| * interface that block type connects it to the component network. |
| * <p/> |
| * This must be called in the init phase, <em>not</em> the pre- or post-init |
| * phases. |
| * |
| * @param driver the driver for a block component. |
| */ |
| void add(Block driver); |
| |
| /** |
| * Registers a new driver for an item component. |
| * <p/> |
| * Item components can inserted into a computers component slots. They have |
| * to specify their type, to determine into which slots they can fit. |
| * <p/> |
| * This must be called in the init phase, <em>not</em> the pre- or post-init |
| * phases. |
| * |
| * @param driver the driver for an item component. |
| */ |
| void add(Item driver); |
| |
| /** |
| * Registers a new type converter. |
| * <p/> |
| * Type converters are used to automatically convert values returned from |
| * callbacks to a "simple" format that can be pushed to any architecture. |
| * <p/> |
| * This must be called in the init phase, <em>not</em> the pre- or post-init |
| * phases. |
| * |
| * @param converter the converter to register. |
| */ |
| void add(Converter converter); |
| } |