Package basicObjects.Factories

Source Code of basicObjects.Factories.singletonBoardFactory

package basicObjects.Factories;

import basicObjects.boardObjects.Board;

public class singletonBoardFactory {

    protected singletonBoardFactory() {
    }
    private static Board board = null;

    public static Board getInstanceOfBoard(String boardType) {
        if (board == null) {
            if (boardType.equals("NORMAL")) {
                board = new Board();
            } //this is to allow for other boards to be added in, in the future
        }
        return board;
    }
}
TOP

Related Classes of basicObjects.Factories.singletonBoardFactory

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.