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 rulejava.util.ArrayList<java.lang.String>
getSquare(int num)
return square with given numberboolean
isEmpty()
check if there is an empty squarevoid
print()
print map of gamevoid
setSquare(java.util.ArrayList<java.lang.String> temp, int num)
set given Array list to given square
-
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 linea
- next disk on the lineb
- next disk on the linec
- next disk on the lined
- next disk on the lineone
- a square that contains start point of linetwo
- a square that contains finish point of lineColor
- 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 listnum
- 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
-