li.cil.oc.api.detail
public interface MachineAPI
| Modifier and Type | Method and Description |
|---|---|
void |
add(java.lang.Class<? extends Architecture> architecture)
Register an architecture that can be used to create new machines.
|
void |
addRomResource(java.lang.Class<? extends Architecture> architecture,
java.util.concurrent.Callable<FileSystem> resource,
java.lang.String name)
Adds a file system to use for the composite file system that is made
available as the ROM to each machine of the specified architecture.
|
java.lang.Iterable<java.lang.Class<? extends Architecture>> |
architectures()
A list of all registered architectures.
|
Machine |
create(Owner owner,
java.lang.Class<? extends Architecture> architecture)
Creates a new machine using the specified architecture.
|
void add(java.lang.Class<? extends Architecture> architecture)
architectures() to be useful.architecture - the architecture to register.java.lang.IllegalArgumentException - if the specified architecture is invalid.void addRomResource(java.lang.Class<? extends Architecture> architecture, java.util.concurrent.Callable<FileSystem> resource, java.lang.String name)
architecture - the the architecture for which to add to the ROM.resource - the file system to add to the ROM.name - a unique name for the file system. This is required
to allow for deterministic loading/saving of the
file system (open file handles). This value must be
unique for each file system in the resource set.java.lang.IllegalArgumentException - if the name is not unique or
the architecture is invalid.java.lang.Iterable<java.lang.Class<? extends Architecture>> architectures()
create(li.cil.oc.api.machine.Owner, Class) with a not yet
registered architecture. What this means is that unless a mod providing
a custom architecture also registers it, you may not see it in this list
until it also created a new machine using that architecture.Machine create(Owner owner, java.lang.Class<? extends Architecture> architecture)
owner - the owner object of the machine, providing context.architecture - the architecture to use for running code on the machine.java.lang.IllegalArgumentException - if the specified architecture is invalid.