package edu.stuy.starlorn.world;

import java.util.ArrayList;

public class Path {
    protected ArrayList<Integer[]> _path;

    public Path() {
        _path = new ArrayList<Integer[]>();
    }

    public void generatePath(int numPoints) {
        //TODO: Get these from Preferences
        int screenWidth = 100;
        int screenHeight = 100;
        for (int i = 0; i < numPoints; i++) {
            Integer[] coords = new Integer[2];
            coords[0] = (int) (Math.random() * screenWidth);
            coords[1] = (int) (Math.random() * screenHeight);
            _path.add(coords);
        }
    }

    public void generatePath() {
        generatePath(10);
    }

    public Integer[] getCoords(int n) {
        return _path.get(n);
    }
    
    public int getPathLength() {
        return _path.size();
    }
}

@@ -193,36 +193,43 @@
   %7D%0A%0A    public 
-void
+static Path
  generatePath(in
@@ -255,42 +255,28 @@
     
-//TODO: Get these from Preferences
+Path p = new Path();
 %0A   
@@ -397,64 +397,13 @@
     
-Integer%5B%5D coords = new Integer%5B2%5D;%0A            coords%5B0%5D
+int x
  = (
@@ -454,17 +454,13 @@
     
-coords%5B1%5D
+int y
  = (
@@ -512,24 +512,24 @@
     
-_path
+p
 .add
-(c
+C
 oords
+(x, y
 );%0A 
@@ -533,24 +533,42 @@
 ;%0A        %7D%0A
+        return p;%0A
     %7D%0A%0A    p
@@ -577,12 +577,19 @@
 lic 
-void
+static Path
  gen
@@ -610,16 +610,28 @@
         
+return Path.
 generate
@@ -717,24 +717,189 @@
 et(n);%0A    %7D
+%0A%0A    public void addCoords(int x, int y) %7B%0A        Integer%5B%5D coords = new Integer%5B2%5D;%0A        coords%5B0%5D = x;%0A        coords%5B1%5D = y;%0A        _path.add(coords);%0A    %7D
 %0A    %0A    pu

Make generatePath static