Interface ILuaAPI


public interface ILuaAPI
Represents a Lua object which is stored as a global variable on computer startup. This must either provide LuaFunction annotated functions or implement IDynamicLuaObject.

Before implementing this interface, consider alternative methods of providing methods. It is generally preferred to use peripherals to provide functionality to users.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the globals this API will be assigned to.
    default void
    Called when the computer is turned off or unloaded.
    default void
    Called when the computer is turned on.
    default void
    Called every time the computer is ticked.
  • Method Details

    • getNames

      String[] getNames()
      Get the globals this API will be assigned to. This will override any other global, so you should
      Returns:
      A list of globals this API will be assigned to.
    • startup

      default void startup()
      Called when the computer is turned on.

      One should only interact with the file system.

    • update

      default void update()
      Called every time the computer is ticked. This can be used to process various.
    • shutdown

      default void shutdown()
      Called when the computer is turned off or unloaded.

      This should reset the state of the object, disposing any remaining file handles, or other resources.