Package com.prineside.tdi2.screens
Class TicTacToeScreen.DynamicSizeBoard
java.lang.Object
com.prineside.tdi2.screens.TicTacToeScreen.Board
com.prineside.tdi2.screens.TicTacToeScreen.DynamicSizeBoard
- Enclosing class:
- TicTacToeScreen
-
Field Summary
Fields inherited from class com.prineside.tdi2.screens.TicTacToeScreen.Board
cellCount, rules
-
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionvoid
cpy()
long[]
static boolean
exactlyTheSame
(long[] bitsA, long[] bitsB) byte
getCell
(short idx) getFittingWinnerMaskAsync
(long[] threadLocalBits) int
getFittingWinnerMasksCountAsync
(long[] threadLocalBits, byte player) int
byte
byte
getWinnerAsync
(long[] threadLocalBits) boolean
void
setCell
(short idx, byte val) Methods inherited from class com.prineside.tdi2.screens.TicTacToeScreen.Board
getCell, getCellIdx, getOpponent, getPlayerName, getRules, hasEmptyCells, isEmpty, toString
-
Constructor Details
-
DynamicSizeBoard
-
DynamicSizeBoard
-
-
Method Details
-
cpy
- Specified by:
cpy
in classTicTacToeScreen.Board
-
hasSameField
- Specified by:
hasSameField
in classTicTacToeScreen.Board
-
getTotalTickCount
public int getTotalTickCount()- Specified by:
getTotalTickCount
in classTicTacToeScreen.Board
-
copyFieldFrom
- Specified by:
copyFieldFrom
in classTicTacToeScreen.Board
-
getCell
public byte getCell(short idx) - Specified by:
getCell
in classTicTacToeScreen.Board
-
setCell
public void setCell(short idx, byte val) - Specified by:
setCell
in classTicTacToeScreen.Board
-
getWinner
public byte getWinner()- Specified by:
getWinner
in classTicTacToeScreen.Board
- Returns:
- winning player's tick (TICK_PLAYER or TICK_ENSOR) or 0 in case nobody has won yet / tie
-
exactlyTheSame
public static boolean exactlyTheSame(long[] bitsA, long[] bitsB) -
getFittingWinnerMask
- Specified by:
getFittingWinnerMask
in classTicTacToeScreen.Board
-
createThreadSafeBits
public long[] createThreadSafeBits() -
getFittingWinnerMaskAsync
- Specified by:
getFittingWinnerMaskAsync
in classTicTacToeScreen.Board
-
getWinnerAsync
public byte getWinnerAsync(long[] threadLocalBits) - Specified by:
getWinnerAsync
in classTicTacToeScreen.Board
-
getFittingWinnerMasksCountAsync
public int getFittingWinnerMasksCountAsync(long[] threadLocalBits, byte player) - Specified by:
getFittingWinnerMasksCountAsync
in classTicTacToeScreen.Board
-