package pylos.model;

import java.util.LinkedList;
import java.util.List;

public class Model {
	public static final int levels = 4;
	public static final int nbBalls = 30;
	public static final List<Ball> balls = new LinkedList<Ball>();
	public static final Player player1 = new Player(+1);
	public static final Player player2 = new Player(-1);
	public static final Player[] players = { player1, player2 };

	public static Player currentPlayer = player1;

	public List<Position> getPositionsToPlaceBallOnBoard() {
		List<Position> list = new LinkedList<Position>();
		// TODO
		if (isBoardEmpty()) {
			for (int i = 0; i < 4; i++) {
				for (int j = 0; j < 4; j++) {
					list.add(new Position(i, j, 0));
				}

			}

		}
		return list;
	}

	public boolean isBoardEmpty() {
		for (Ball ball : balls) {
			if (ball.onBoard)
				return false;
		}
		return true;
	}

	public List<Position> getWhereToPlaceBallToCarryUp(Ball ball) {
		List<Position> list = new LinkedList<Position>();
		// TODO
		return list;
	}

	public static int ballsBySideAtLevel(int level) {
		return levels - level;
	}
}
@@ -608,23 +608,23 @@
 int 
-i
+x
  = 0; 
-i
+x
  %3C 4; 
-i
+x
 ++) 
@@ -642,23 +642,23 @@
 int 
-j
+y
  = 0; 
-j
+y
  %3C 4; 
-j
+y
 ++) 
@@ -690,12 +690,12 @@
 ion(
-i, j
+x, y
 , 0)

use better variable names when they actually mean something