Skip to main content

Script

Trait Script 

Source
pub trait Script {
    // Provided methods
    fn init(&mut self) { ... }
    fn actions() -> Vec<RegisterAction> { ... }
    fn tick(&mut self) { ... }
    fn on_message(&mut self, msg: Message) { ... }
}
Expand description

Haupt-Trait für LOTUS-Script-Implementierungen.

Main trait for LOTUS script implementations.

Provided Methods§

Source

fn init(&mut self)

Wird einmal beim Laden des Scripts aufgerufen.

Called once when the script is loaded.

Source

fn actions() -> Vec<RegisterAction>

Registriert Eingabeaktionen; Standard: leere Liste.

Registers input actions; defaults to an empty list.

Source

fn tick(&mut self)

Wird pro Simulations-Tick aufgerufen.

Called once per simulation tick.

Source

fn on_message(&mut self, msg: Message)

Verarbeitet eine eingehende Nachricht.

Handles an incoming message.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§