Class GameRules
java.lang.Object
GameRules
public class GameRules
extends java.lang.Object
provide game rules
-
Constructor Summary
Constructors Constructor Description GameRules()
creat new game rules -
Method Summary
Modifier and Type Method Description boolean
checkWinner(java.lang.String Color)
check all the lines with wining condition for a player - check circles colorvoid
print()
print map after applying rulesvoid
putDisk(java.lang.String Color)
put disk in map for player with given colorvoid
rotate()
rotate square in mapvoid
rotateSquare(int numberOfSquare, java.lang.String direction)
rotate given square with given direction
-
Constructor Details
-
GameRules
public GameRules()creat new game rules
-
-
Method Details
-
checkWinner
public boolean checkWinner(java.lang.String Color)check all the lines with wining condition for a player - check circles color- Parameters:
Color
- of player- Returns:
- true or false
-
rotateSquare
public void rotateSquare(int numberOfSquare, java.lang.String direction)rotate given square with given direction- Parameters:
numberOfSquare
- number of Array listdirection
- of rotate
-
rotate
public void rotate()rotate square in map -
putDisk
public void putDisk(java.lang.String Color)put disk in map for player with given color- Parameters:
Color
- of player
-
print
public void print()print map after applying rules
-