turing-api 0.0.4

The Turing mod scripting API for Beat Saber
Documentation

Turing API

The rust Turing scripting API for Beat Saber

This API exposes methods defined by the Turing mod for Beat Saber map scripting

This is a work-in-progress and will not be usable until the Turing mod is released (probably will be a while)

Traits

UnityConvertible

pub trait UnityConvertible {
  type UnityType;
  fn to_unity_type(self) -> Self::UnityType;
  fn from_unity_type(t: Self::UnityType) -> Self;
}

Structs

Static types


Beatmap

impl Beatmap {
  
  pub fn add_color_note(note: ColorNote) { ... }
  
  pub fn add_bomb_note(note: ColorNote) { ... }
  
  pub fn add_chain_head_note(note: ColorNote) { ... }
  
  pub fn add_chain_link_note(note: ColorNote) { ... }
  
  pub fn add_chain_note(note: ColorNote) { ... }
  
  pub fn add_arc(note: ColorNote) { ... }
  
  pub fn add_wall(note: ColorNote) { ... }
  
}

Data

impl Data {

  pub fn set_temp_value<T>(key: &str, v: T) {...}

  pub fn get_temp_value<T>(key: &str) -> Option<T> {...}

  pub fn remove_temp_value(key: &str) {...}

}

Log

impl Log {
  
  pub fn info(message: &str) {...}

  pub fn warning(message: &str) {...}

  pub fn error(message: &str) {...}

  pub fn debug(message: &str) {...}
  
}

Instanced types


Color

impl Color {
  pub fn set_rgb(&mut self, r: f32, g: f32, b: f32) {...}
  pub fn set_rgba(&mut self, r: f32, g: f32, b: f32, a: f32) {...}
}

ColorNote


BombNote


ChainHeadNote


ChainLinkNote


ChainNote


Arc


Wall


Saber


Vec2

impl Vec2 {
  pub fn get_x(&self) -> f32 { ... }
  pub fn get_y(&self) -> f32 { ... }
  
  pub fn set_x(&self, x: f32) { ... }
  pub fn set_y(&self, y: f32) { ... }
}
impl UnityConvertible for glam::Vec2 {
  type UnityType = Vec2;
  // ...
}

Vec3

impl Vec3 {
  pub fn get_x(&self) -> f32 { ... }
  pub fn get_y(&self) -> f32 { ... }
  pub fn get_z(&self) -> f32 { ... }
  
  pub fn set_x(&self, x: f32) { ... }
  pub fn set_y(&self, y: f32) { ... }
  pub fn set_z(&self, z: f32) { ... }
}
impl UnityConvertible for glam::Vec3 {
  type UnityType = Vec3;
  // ...
}

Vec4

impl Vec4 {
  pub fn get_x(&self) -> f32 { ... }
  pub fn get_y(&self) -> f32 { ... }
  pub fn get_z(&self) -> f32 { ... }
  pub fn get_w(&self) -> f32 { ... }
  
  pub fn set_x(&self, x: f32) { ... }
  pub fn set_y(&self, y: f32) { ... }
  pub fn set_z(&self, z: f32) { ... }
  pub fn set_w(&self, z: f32) { ... }
}
impl UnityConvertible for glam::Vec4 {
  type UnityType = Vec4;
  // ...
}

Quat

impl Quat {
  pub fn get_x(&self) -> f32 { ... }
  pub fn get_y(&self) -> f32 { ... }
  pub fn get_z(&self) -> f32 { ... }
  pub fn get_w(&self) -> f32 { ... }
  
  pub fn set_x(&self, x: f32) { ... }
  pub fn set_y(&self, y: f32) { ... }
  pub fn set_z(&self, z: f32) { ... }
  pub fn set_w(&self, z: f32) { ... }
}
impl UnityConvertible for glam::Quat {
  type UnityType = Quat;
  // ...
}

Static Functions

pub fn create_color_note(beat: f32) -> ColorNote {...}
pub fn create_bomb_note(beat: f32) -> BombNote {...}
pub fn create_chain_head_note(beat: f32) -> ChainHeadNote {...}
pub fn create_chain_link_note(beat: f32) -> ChainLinkNote {...}
pub fn create_chain_note(beat: f32) -> ChainNote {...}
pub fn create_arc(beat: f32) -> Arc {...}
pub fn create_wall(beat: f32) -> Wall {...}