Point2D -> Point
[kaka/rust-sdl-test.git] / src / core / level / lvlgen.rs
index 3dcc3a7..d2a389e 100644 (file)
@@ -1,5 +1,5 @@
 use {point, time_scope};
-use common::Point2D;
+use common::Point;
 use super::{Grid, Level};
 use noise::{NoiseFn, OpenSimplex, Seedable};
 use rand::Rng;
@@ -220,7 +220,7 @@ impl LevelGenerator {
        }
     }
 
-    fn find_walls(&self, grid: &Grid) -> Vec<Vec<Point2D<isize>>> {
+    fn find_walls(&self, grid: &Grid) -> Vec<Vec<Point<isize>>> {
        let mut walls = vec!();
        for r in self.find_regions(&grid) {
            if r.value {
@@ -256,7 +256,7 @@ impl Region {
        (min.0, min.1, 1 + max.0 - min.0, 1 + max.1 - min.1)
     }
 
-    pub fn outline(&self, scale: usize) -> Vec<Point2D<isize>> {
+    pub fn outline(&self, scale: usize) -> Vec<Point<isize>> {
        let rect = self.enclosing_rect();
        let (ox, oy, w, h) = rect;
        let grid = self.grid(&rect);
@@ -313,7 +313,7 @@ impl Region {
        grid
     }
 
-    fn find_first_point_of_outline(&self, rect: &(usize, usize, usize, usize), grid: &Vec<Vec<bool>>) -> Point2D<isize> {
+    fn find_first_point_of_outline(&self, rect: &(usize, usize, usize, usize), grid: &Vec<Vec<bool>>) -> Point<isize> {
        let (ox, oy, w, h) = rect;
        let is_outer_wall = (ox, oy) == (&0, &0); // we know this is always the outer wall of the level
        for x in 0..*w {
@@ -329,7 +329,7 @@ impl Region {
        panic!("no wall found!");
     }
 
-    fn find_next_point_of_outline(&self, grid: &Vec<Vec<bool>>, p: &mut Point2D<isize>, directions: &mut Vec<(isize, isize)>) {
+    fn find_next_point_of_outline(&self, grid: &Vec<Vec<bool>>, p: &mut Point<isize>, directions: &mut Vec<(isize, isize)>) {
        directions.rotate_left(2);
        loop {
            let d = directions[0];
@@ -341,7 +341,7 @@ impl Region {
        }
     }
 
-    fn check(&self, p: Point2D<isize>, grid: &Vec<Vec<bool>>) -> bool {
+    fn check(&self, p: Point<isize>, grid: &Vec<Vec<bool>>) -> bool {
        if p.x < 0 || p.x >= grid.len() as isize || p.y < 0 || p.y >= grid[0].len() as isize {
            false
        } else {