mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
Start TEngine3.0
Start TEngine3.0
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
pub struct LoadError {
|
||||
|
||||
}
|
||||
|
||||
impl std::fmt::Debug for LoadError {
|
||||
fn fmt(&self, _: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> { Ok(()) }
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub struct Vector2 {
|
||||
pub x:f32,
|
||||
pub y:f32,
|
||||
}
|
||||
|
||||
impl Vector2 {
|
||||
pub fn new(__js:&json::JsonValue) -> Result<Vector2, LoadError> {
|
||||
Ok(Vector2{
|
||||
x: match __js["x"].as_f32() { Some(__x__) => __x__, None => return Err(LoadError{})},
|
||||
y: match __js["y"].as_f32() { Some(__x__) => __x__, None => return Err(LoadError{})},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub struct Vector3 {
|
||||
pub x:f32,
|
||||
pub y:f32,
|
||||
pub z:f32,
|
||||
}
|
||||
|
||||
impl Vector3 {
|
||||
pub fn new(__js:&json::JsonValue) -> Result<Vector3, LoadError> {
|
||||
Ok(Vector3{
|
||||
x: match __js["x"].as_f32() { Some(__x__) => __x__, None => return Err(LoadError{})},
|
||||
y: match __js["y"].as_f32() { Some(__x__) => __x__, None => return Err(LoadError{})},
|
||||
z: match __js["z"].as_f32() { Some(__x__) => __x__, None => return Err(LoadError{})},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub struct Vector4 {
|
||||
pub x:f32,
|
||||
pub y:f32,
|
||||
pub z:f32,
|
||||
pub w:f32,
|
||||
}
|
||||
|
||||
|
||||
impl Vector4 {
|
||||
pub fn new(__js:&json::JsonValue) -> Result<Vector4, LoadError> {
|
||||
Ok(Vector4{
|
||||
x: match __js["x"].as_f32() { Some(__x__) => __x__, None => return Err(LoadError{})},
|
||||
y: match __js["y"].as_f32() { Some(__x__) => __x__, None => return Err(LoadError{})},
|
||||
z: match __js["z"].as_f32() { Some(__x__) => __x__, None => return Err(LoadError{})},
|
||||
w: match __js["w"].as_f32() { Some(__x__) => __x__, None => return Err(LoadError{})},
|
||||
})
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user