diff --git a/src/ThreadsController.java b/src/ThreadsController.java index 3df2d3d..0ef4e74 100644 --- a/src/ThreadsController.java +++ b/src/ThreadsController.java @@ -15,7 +15,7 @@ public class ThreadsController extends Thread { //Constructor of ControlleurThread ThreadsController(Tuple positionDepart){ //Get all the threads - Squares=Window.Grid; + Squares=Window.grid; headSnakePos=new Tuple(positionDepart.x,positionDepart.y); directionSnake = 1; @@ -104,30 +104,30 @@ private Tuple getValAleaNotInSnake(){ private void moveInterne(int dir){ switch(dir){ case 4: - headSnakePos.ChangeData(headSnakePos.x,(headSnakePos.y+1)%20); + headSnakePos.changeData(headSnakePos.x,(headSnakePos.y+1)%20); positions.add(new Tuple(headSnakePos.x,headSnakePos.y)); break; case 3: if(headSnakePos.y-1<0){ - headSnakePos.ChangeData(headSnakePos.x,19); + headSnakePos.changeData(headSnakePos.x,19); } else{ - headSnakePos.ChangeData(headSnakePos.x,Math.abs(headSnakePos.y-1)%20); + headSnakePos.changeData(headSnakePos.x,Math.abs(headSnakePos.y-1)%20); } positions.add(new Tuple(headSnakePos.x,headSnakePos.y)); break; case 2: if(headSnakePos.x-1<0){ - headSnakePos.ChangeData(19,headSnakePos.y); + headSnakePos.changeData(19,headSnakePos.y); } else{ - headSnakePos.ChangeData(Math.abs(headSnakePos.x-1)%20,headSnakePos.y); + headSnakePos.changeData(Math.abs(headSnakePos.x-1)%20,headSnakePos.y); } positions.add(new Tuple(headSnakePos.x,headSnakePos.y)); break; case 1: - headSnakePos.ChangeData(Math.abs(headSnakePos.x+1)%20,headSnakePos.y); + headSnakePos.changeData(Math.abs(headSnakePos.x+1)%20,headSnakePos.y); positions.add(new Tuple(headSnakePos.x,headSnakePos.y)); break; } diff --git a/src/Tuple.java b/src/Tuple.java index ccebdb2..acfad0b 100644 --- a/src/Tuple.java +++ b/src/Tuple.java @@ -8,7 +8,7 @@ public Tuple(int x, int y) { this.x = x; this.y = y; } - public void ChangeData(int x, int y){ + public void changeData(int x, int y){ this.x = x; this.y = y; } diff --git a/src/Window.java b/src/Window.java index 518fa9e..b7f5355 100644 --- a/src/Window.java +++ b/src/Window.java @@ -7,14 +7,14 @@ class Window extends JFrame{ private static final long serialVersionUID = -2542001418764869760L; - public static ArrayList> Grid; + public static ArrayList> grid; public static int width = 20; public static int height = 20; public Window(){ // Creates the arraylist that'll contain the threads - Grid = new ArrayList>(); + grid = new ArrayList>(); ArrayList data; // Creates Threads and its data and adds it to the arrayList @@ -24,7 +24,7 @@ public Window(){ DataOfSquare c = new DataOfSquare(2); data.add(c); } - Grid.add(data); + grid.add(data); } // Setting up the layout of the panel @@ -33,7 +33,7 @@ public Window(){ // Start & pauses all threads, then adds every square of each thread to the panel for(int i=0;i