@@ -0,0 +1,1910 @@
+package com.alexrnl.gameoflife.world;%0D%0A%0D%0Aimport java.util.Collections;%0D%0Aimport java.util.HashMap;%0D%0Aimport java.util.Map;%0D%0A%0D%0Aimport com.alexrnl.commons.utils.object.ImmutablePair;%0D%0A%0D%0A/**%0D%0A * Class representing the world with the cells.%0D%0A * @author barfety_a%0D%0A */%0D%0Apublic class World %7B%0D%0A%09/** The width of the world */%0D%0A%09private final int%09%09%09%09%09%09%09%09%09%09%09width;%0D%0A%09/** The height of the world */%0D%0A%09private final int%09%09%09%09%09%09%09%09%09%09%09height;%0D%0A%09/** The grid of cells */%0D%0A%09private final Map%3CImmutablePair%3CInteger, Integer%3E, Cell%3E%09cells;%0D%0A%09%0D%0A%09/**%0D%0A%09 * Constructor #1.%3Cbr /%3E%0D%0A%09 * Initialize a world with the dimension specified, and dead cells.%0D%0A%09 * @param width%0D%0A%09 *        the width of the world.%0D%0A%09 * @param height%0D%0A%09 *        the height of the world.%0D%0A%09 */%0D%0A%09public World (final int width, final int height) %7B%0D%0A%09%09super();%0D%0A%09%09this.width = width;%0D%0A%09%09this.height = height;%0D%0A%09%09final Map%3CImmutablePair%3CInteger, Integer%3E, Cell%3E cellsMap = new HashMap%3C%3E(width*height, 1.0f);%0D%0A%09%09for (int indexWidth = 1; indexWidth %3C= width; indexWidth++) %7B%0D%0A%09%09%09for (int indexHeight = 1; indexHeight %3C= height; indexHeight++) %7B%0D%0A%09%09%09%09cellsMap.put(new ImmutablePair%3C%3E(indexWidth, indexHeight), new Cell(State.DEAD));%0D%0A%09%09%09%7D%0D%0A%09%09%7D%0D%0A%09%09cells = Collections.unmodifiableMap(cellsMap);%0D%0A%09%7D%0D%0A%09%0D%0A%09/**%0D%0A%09 * Return the attribute width.%0D%0A%09 * @return the attribute width.%0D%0A%09 */%0D%0A%09public int getWidth () %7B%0D%0A%09%09return width;%0D%0A%09%7D%0D%0A%09%0D%0A%09/**%0D%0A%09 * Return the attribute height.%0D%0A%09 * @return the attribute height.%0D%0A%09 */%0D%0A%09public int getHeight () %7B%0D%0A%09%09return height;%0D%0A%09%7D%0D%0A%09%0D%0A%09/**%0D%0A%09 * Return the cell at the position specified.%0D%0A%09 * @param x%0D%0A%09 *        the position on the x axis of the grid (from 0 to %7B@link #getWidth()%7D).%0D%0A%09 * @param y%0D%0A%09 *        the position on the y axis of the grid (from 0 to %7B@link #getHeight()%7D).%0D%0A%09 * @return the cell at this position.%0D%0A%09 */%0D%0A%09public Cell getCellAt (final int x, final int y) %7B%0D%0A%09%09return cells.get(new ImmutablePair%3C%3E(x, y));%0D%0A%09%7D%0D%0A%7D%0D%0A

Add initial version of World class