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
-
Method Summary
Modifier and TypeMethodDescriptionint
getCnt()
boolean
Check if the target number is reached.void
notifyAllObservers
(DataPackage dataPackage) Notify all observers that listen to this GameLayer.void
Define what to initialize before the game starts.void
setTotal
(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:GameLayer
Define what to initialize before the game starts.- Specified by:
onGameStart
in interfaceGameLayer
-
isGameEnd
public boolean isGameEnd()Check if the target number is reached. -
notifyAllObservers
Description copied from interface:GameLayer
Notify all observers that listen to this GameLayer.- Specified by:
notifyAllObservers
in interfaceGameLayer
- Parameters:
dataPackage
- - relavent data received from game
-