nano_ogmo/
lib.rs

1mod level;
2mod project;
3mod tileset;
4
5pub use level::*;
6pub use project::*;
7
8use nanoserde::DeJson;
9
10#[derive(Clone, Debug, DeJson, PartialEq)]
11pub struct Vec2f32 {
12    pub x: f32,
13    pub y: f32,
14}
15
16#[derive(Clone, Debug, DeJson, PartialEq)]
17pub struct Vec2i32 {
18    pub x: i32,
19    pub y: i32,
20}
21
22#[derive(Debug, Clone)]
23pub struct OgmoError {
24    message: String,
25}
26impl OgmoError {
27    pub fn new<T: Into<String>>(msg: T) -> Self {
28        OgmoError {
29            message: msg.into(),
30        }
31    }
32}
33
34impl std::convert::From<nanoserde::DeJsonErr> for OgmoError {
35    fn from(e: nanoserde::DeJsonErr) -> OgmoError {
36        OgmoError {
37            message: e.to_string(),
38        }
39    }
40}