Class Map

java.lang.Object
Map

public class Map
extends java.lang.Object
this class provide map info and applications - board game
  • Constructor Summary

    Constructors 
    Constructor Description
    Map()
    creat a new map for board game
  • Method Summary

    Modifier and Type Method Description
    int checkLine​(int main, int a, int b, int c, int d, java.util.ArrayList<java.lang.String> one, java.util.ArrayList<java.lang.String> two, java.lang.String Color)
    check given line of map that allows player to win - provide game wining rule
    java.util.ArrayList<java.lang.String> getSquare​(int num)
    return square with given number
    boolean isEmpty()
    check if there is an empty square
    void print()
    print map of game
    void setSquare​(java.util.ArrayList<java.lang.String> temp, int num)
    set given Array list to given square

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Map

      public Map()
      creat a new map for board game
  • Method Details

    • checkLine

      public int checkLine​(int main, int a, int b, int c, int d, java.util.ArrayList<java.lang.String> one, java.util.ArrayList<java.lang.String> two, java.lang.String Color)
      check given line of map that allows player to win - provide game wining rule
      Parameters:
      main - start point of line
      a - next disk on the line
      b - next disk on the line
      c - next disk on the line
      d - next disk on the line
      one - a square that contains start point of line
      two - a square that contains finish point of line
      Color - color of player
      Returns:
      number of line with given condition of wining
    • getSquare

      public java.util.ArrayList<java.lang.String> getSquare​(int num)
      return square with given number
      Parameters:
      num - of square
      Returns:
      Array list
    • setSquare

      public void setSquare​(java.util.ArrayList<java.lang.String> temp, int num)
      set given Array list to given square
      Parameters:
      temp - given array list
      num - of square
    • isEmpty

      public boolean isEmpty()
      check if there is an empty square
      Returns:
      true of false
    • print

      public void print()
      print map of game