Package pl.michalostruszka.gameoflife

Source Code of pl.michalostruszka.gameoflife.GameOfLife

package pl.michalostruszka.gameoflife;

import pl.michalostruszka.gameoflife.board.Board;

public class GameOfLife {

    private Board currentState;

    public GameOfLife(Board initialState) {
        currentState = initialState;
    }

    public GameOfLife() {
        currentState = new Board();
    }

    public Board currentBoardState() {
        return currentState;
    }

    public void tick(int ticksCount) {
        for (int i = 0; i < ticksCount; i++) {
            this.currentState = currentState.nextState();
        }
    }

}
TOP

Related Classes of pl.michalostruszka.gameoflife.GameOfLife

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.