Added a supercover line algorithm for better collision detection
[kaka/rust-sdl-test.git] / src / common / mod.rs
index 3f5ba26..675d973 100644 (file)
@@ -1,8 +1,23 @@
 mod geometry;
-pub use common::geometry::Point;
-pub use common::geometry::Rect;
-pub use common::geometry::Radians;
-pub use common::geometry::Degrees;
+pub use common::geometry::{
+    Point,
+    Dimension,
+    Radians,
+    Degrees,
+    Intersection,
+    supercover_line,
+};
 
 mod time;
 pub use common::time::ScopeTimer;
+
+#[macro_export]
+macro_rules! hashmap {
+    ($($k:expr => $v:expr),*) => {
+       {
+           let mut map = std::collections::HashMap::new();
+           $(map.insert($k, $v);)*
+           map
+       }
+    }
+}