/**
   * Default constructor for objects of class GameOfLife
   *
   * @post the game will be initialized and populated with the initial state of cells
   */
  public GameOfLife() {
    // create the grid, of the specified size, that contains Actors
    BoundedGrid<Actor> grid = new BoundedGrid<Actor>(ROWS, COLS);

    // create a world based on the grid
    world = new ActorWorld(grid);

    // populate the game
    populateGame();

    // display the newly constructed and populated world
    world.show();
  }
Ejemplo n.º 2
0
  /**
   * Default constructor for objects of class GameOfLife
   *
   * @post the game will be initialized and populated with the initial state of cells
   */
  public GameOfLife(boolean test) {
    // create the grid, of the specified size, that contains Actors
    UnboundedGrid<Actor> grid = new UnboundedGrid<Actor>();

    // create a world based on the grid
    world = new ActorWorld(grid);

    // populate the game
    populateGame(test);

    // display the newly constructed and populated world
    world.show();
  }