3 个版本

0.1.2 2022年4月23日
0.1.1 2019年9月27日
0.1.0 2019年9月27日

#232模拟

MIT 许可证

12KB
137

Lib Rail Driver

Rust FFI 绑定到 RailDriver.dll 库。

这些允许您读取和写入 Train Simulator 2020 的数据。请注意,此功能不适用于 Train Sim World。

快速示例

extern crate libraildriver;

fn main() {
    let context = libraildriver::Context::new();
    let speed = context.get_value(libraildriver::Value::Speedometer,
                  libraildriver::Kind::Current).expect("Failed to get value.");
    println!("The train's current speed is: {}", speed);
}

lib.rs:

Lib Rail Driver

Rust FFI 绑定到 RailDriver.dll 库。

这些允许您读取和写入 Train Simulator 2020 的数据。请注意,此功能不适用于 Train Sim World。

快速示例

extern crate libraildriver;

fn main() {
    let context = libraildriver::Context::new();
    let speed = context.get_value(libraildriver::Value::Speedometer,
                  libraildriver::Kind::Current).expect("Failed to get value.");
    println!("The train's current speed is: {}", speed);
}

依赖项

~98–310KB