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 color
    void print()
    print map after applying rules
    void putDisk​(java.lang.String Color)
    put disk in map for player with given color
    void rotate()
    rotate square in map
    void rotateSquare​(int numberOfSquare, java.lang.String direction)
    rotate given square with given direction

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 list
      direction - 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