@Test public void testThatWhenLoadWorldFromIsCalledThenGameOfLifeDrawerCalculatesStateForAllCells() { gameOfLife.loadWorldFrom(rainbowImage); for (int i = 0; i < AUTOMATA_WIDTH; i++) { for (int j = 0; j < AUTOMATA_HEIGHT; j++) { verify(gameOfLifeDrawer).getCellStateFrom(rainbowImage, i, j); } } }
public void loadWorldFrom(RainbowImage image) { for (int i = 0; i < gameOfLifeAutomata.getWidth(); i++) { for (int j = 0; j < gameOfLifeAutomata.getHeight(); j++) { gameOfLifeAutomata.getCells()[i][j] = gameOfLifeDrawer.getCellStateFrom(image, i, j); } } }
GameOfLife implements RainbowInputController.RainbowInteractionListener, OnCellUpdatedCallback2D, RainbowDrawer.PointDetectedListener { public void loadWorldFrom(RainbowImage image) { for (int i = 0; i < gameOfLifeAutomata.getWidth(); i++) { for (int j = 0; j < gameOfLifeAutomata.getHeight(); j++) { gameOfLifeAutomata.getCells()[i][j] = gameOfLifeDrawer.getCellStateFrom(image, i, j); } } } }
GameOfLife implements RainbowInputController.RainbowInteractionListener, OnCellUpdatedCallback2D, RainbowDrawer.PointDetectedListener { public void loadWorldFrom(RainbowImage image) { for (int i = 0; i < gameOfLifeAutomata.getWidth(); i++) { for (int j = 0; j < gameOfLifeAutomata.getHeight(); j++) { gameOfLifeAutomata.getCells()[i][j] = gameOfLifeDrawer.getCellStateFrom(image, i, j); } } } @VisibleForTesting  GameOfLife(AutomataDiscrete2D gameOfLifeAutomata, GameOfLifeDrawer gameOfLifeDrawer, RainbowInputController rainbowInputController); }
GameOfLife implements RainbowInputController.RainbowInteractionListener, OnCellUpdatedCallback2D, RainbowDrawer.PointDetectedListener { public void loadWorldFrom(RainbowImage image) { for (int i = 0; i < gameOfLifeAutomata.getWidth(); i++) { for (int j = 0; j < gameOfLifeAutomata.getHeight(); j++) { gameOfLifeAutomata.getCells()[i][j] = gameOfLifeDrawer.getCellStateFrom(image, i, j); } } } @VisibleForTesting  GameOfLife(AutomataDiscrete2D gameOfLifeAutomata, GameOfLifeDrawer gameOfLifeDrawer, RainbowInputController rainbowInputController); static GameOfLife newInstance(RainbowDrawer rainbowDrawer,
                                         RainbowInputController rainbowInputController); void doStep(); @Override void onCellDetected(int x, int y, int state); @Override void onSketchTouched(MotionEvent motionEvent); @Override void onSketchReleased(MotionEvent motionEvent); @Override void onFingerDragged(MotionEvent motionEvent); @Override void onPointDetected(float px, float py, float x, float y); @Override void onMotionEvent(MotionEvent motionEvent); void startEdition(); void endEdition(); void clear(); void restoreLastWorld(); void loadWorldFrom(RainbowImage image); }
GameOfLife implements RainbowInputController.RainbowInteractionListener, OnCellUpdatedCallback2D, RainbowDrawer.PointDetectedListener { public void loadWorldFrom(RainbowImage image) { for (int i = 0; i < gameOfLifeAutomata.getWidth(); i++) { for (int j = 0; j < gameOfLifeAutomata.getHeight(); j++) { gameOfLifeAutomata.getCells()[i][j] = gameOfLifeDrawer.getCellStateFrom(image, i, j); } } } @VisibleForTesting  GameOfLife(AutomataDiscrete2D gameOfLifeAutomata, GameOfLifeDrawer gameOfLifeDrawer, RainbowInputController rainbowInputController); static GameOfLife newInstance(RainbowDrawer rainbowDrawer,
                                         RainbowInputController rainbowInputController); void doStep(); @Override void onCellDetected(int x, int y, int state); @Override void onSketchTouched(MotionEvent motionEvent); @Override void onSketchReleased(MotionEvent motionEvent); @Override void onFingerDragged(MotionEvent motionEvent); @Override void onPointDetected(float px, float py, float x, float y); @Override void onMotionEvent(MotionEvent motionEvent); void startEdition(); void endEdition(); void clear(); void restoreLastWorld(); void loadWorldFrom(RainbowImage image);  }