Package sac.model.gamemodes
Class LineCountLayer
java.lang.Object
sac.model.gamemodes.LineCountLayer
- All Implemented Interfaces:
GameLayer
Count the number of lines cleared in the game.
End the game if the target number is reached.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetCnt()booleanCheck if the target number is reached.voidnotifyAllObservers(DataPackage dataPackage) Notify all observers that listen to this GameLayer.voidDefine what to initialize before the game starts.voidsetTotal(int total) Set a target number of lines to be cleared.
-
Constructor Details
-
LineCountLayer
public LineCountLayer()
-
-
Method Details
-
setTotal
public void setTotal(int total) Set a target number of lines to be cleared.- Parameters:
total-
-
getCnt
public int getCnt()- Returns:
- current number of lines cleared
-
onGameStart
public void onGameStart()Description copied from interface:GameLayerDefine what to initialize before the game starts.- Specified by:
onGameStartin interfaceGameLayer
-
isGameEnd
public boolean isGameEnd()Check if the target number is reached. -
notifyAllObservers
Description copied from interface:GameLayerNotify all observers that listen to this GameLayer.- Specified by:
notifyAllObserversin interfaceGameLayer- Parameters:
dataPackage- - relavent data received from game
-