|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IComputerAccess
The interface passed to peripherals by computers or turtles, providing methods that they can call. This should not be implemented by your classes. Do not interact with computers except via this interface.
Method Summary | |
---|---|
java.lang.String |
getAttachmentName()
Get a string, unique to the computer, by which the computer refers to this peripheral. |
int |
getID()
Returns the numerical ID of this computer. This is the same number obtained by calling os.getComputerID() or running the "id" program from lua, and is guarunteed unique. |
java.lang.String |
mount(java.lang.String desiredLocation,
IMount mount)
Mount a mount onto the computers' file system in a read only mode. |
java.lang.String |
mountWritable(java.lang.String desiredLocation,
IWritableMount mount)
Mount a mount onto the computers' file system in a writable mode. |
void |
queueEvent(java.lang.String event,
java.lang.Object[] arguments)
Causes an event to be raised on this computer, which the computer can respond to by calling os.pullEvent(). |
void |
unmount(java.lang.String location)
Unmounts a directory previously mounted onto the computers file system by mount() or mountWritable(). When a directory is unmounted, it will disappear from the computers file system, and the user will no longer be able to access it. |
Method Detail |
---|
java.lang.String mount(java.lang.String desiredLocation, IMount mount)
desiredLoction
- The location on the computer's file system where you would like the mount to be mounted.mount
- The mount object to mount on the computer. These can be obtained by calling ComputerCraftAPI.createSaveDirMount(), ComputerCraftAPI.createResourceMount() or by creating your own objects that implement the IMount interface.
ComputerCraftAPI#createSaveDirMount(World, String)
,
ComputerCraftAPI.createResourceMount(Class, String, String)
,
mountWritable(String, IWritableMount)
,
unmount(String)
,
IMount
java.lang.String mountWritable(java.lang.String desiredLocation, IWritableMount mount)
desiredLoction
- The location on the computer's file system where you would like the mount to be mounted.mount
- The mount object to mount on the computer. These can be obtained by calling ComputerCraftAPI.createSaveDirMount() or by creating your own objects that implement the IWritableMount interface.
ComputerCraftAPI#createSaveDirMount(World, String)
,
ComputerCraftAPI.createResourceMount(Class, String, String)
,
mount(String, IMount)
,
unmount(String)
,
IMount
void unmount(java.lang.String location)
location
- The desired location in the computers file system of the directory to unmount.
This must be the location of a directory previously mounted by mount() or mountWritable(), as
indicated by their return value.mount(String, IMount)
,
mountWritable(String, IWritableMount)
int getID()
void queueEvent(java.lang.String event, java.lang.Object[] arguments)
event
- A string identifying the type of event that has occurred, this will be
returned as the first value from os.pullEvent(). It is recommended that you
you choose a name that is unique, and recognisable as originating from your
peripheral. eg: If your peripheral type is "button", a suitable event would be
"button_pressed".arguments
- In addition to a name, you may pass an array of extra arguments to the event, that will
be supplied as extra return values to os.pullEvent(). Objects in the array will be converted
to lua data types in the same fashion as the return values of IPeripheral.callMethod().IPeripheral.callMethod(dan200.computer.api.IComputerAccess, dan200.computer.api.ILuaContext, int, java.lang.Object[])
java.lang.String getAttachmentName()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |