|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectandroid.view.View
android.view.ViewGroup
android.widget.FrameLayout
us.the.mac.board.Board
public abstract class Board
The Board class contains all added pieces, internal squares, and handles
the functions that make up the Android User Experience.
It is used as a parent class of other types of boards (Chess, Xiangqi, etc.),
and receives piece logic to provide the game functionality.
| Nested Class Summary | |
|---|---|
static class |
Board.Color
The Color enum contains the color of a piece. For Example: If a piece is White its value will be, Board.Color.WHITE. |
static interface |
Board.EndGamePiece
The EndGamePiece interface handles the callback for the type of piece that ends the game. For Example: In games like Chess or Xiangqi, this interface is implemented by the King pieces. |
static class |
Board.LayoutParams
|
protected static class |
Board.PGNEvent
|
static class |
Board.Piece
This class contains all the general functions of a piece. It is used as a parent class of other types of pieces (Knight, Pawn, etc.), and contains all the board data. |
protected class |
Board.Player
The player class is used to allow a piece to be selected of a specific color. |
static class |
Board.Report
|
static class |
Board.ServerConnection
|
class |
Board.Square
The Square class contains all needed squares, and handles the piece that is on it through its moves data to interact with other squares. |
| Nested classes/interfaces inherited from class android.view.ViewGroup |
|---|
ViewGroup.MarginLayoutParams, ViewGroup.OnHierarchyChangeListener |
| Nested classes/interfaces inherited from class android.view.View |
|---|
View.BaseSavedState, View.MeasureSpec, View.OnClickListener, View.OnCreateContextMenuListener, View.OnFocusChangeListener, View.OnKeyListener, View.OnLongClickListener, View.OnTouchListener |
| Field Summary | |
|---|---|
static boolean |
client
FOR CREATING AND UPDATING ALL BOARD SQUARE INSTANCES |
protected Board.Color |
mCurrentColor
FOR CONTAINING FIRST BOARD PLAYER |
static boolean |
moveReceivedFromOpponent
FOR CREATING AND UPDATING ALL BOARD SQUARE INSTANCES |
protected Board.Color |
mPrimaryColor
FOR CONTAINING FIRST BOARD PLAYER |
static boolean |
STARTED_CONNECTION
|
| Fields inherited from class android.view.ViewGroup |
|---|
CLIP_TO_PADDING_MASK, FOCUS_AFTER_DESCENDANTS, FOCUS_BEFORE_DESCENDANTS, FOCUS_BLOCK_DESCENDANTS, PERSISTENT_ALL_CACHES, PERSISTENT_ANIMATION_CACHE, PERSISTENT_NO_CACHE, PERSISTENT_SCROLLING_CACHE |
| Constructor Summary | |
|---|---|
Board(Context context,
AttributeSet attrs)
This constructor is used to access a Board from android xml layout files. |
|
| Method Summary | |
|---|---|
void |
cancelGame()
|
protected boolean |
checkLayoutParams(ViewGroup.LayoutParams p)
|
String |
convertToFEN()
8/8/8/8/3n4/8/8/8 w - - 0 1 |
protected void |
currentPieceMovement(Board.Square squ)
This method is used to access the current Square selected after selecting a piece. |
protected void |
currentPieceMovement(int squ)
This method is used to access the current Square selected after selecting a piece. |
protected void |
currentSelection(Board.Square squ)
This method is used to access the current Square selected before selecting a piece. |
protected void |
currentSelection(int squ)
This method is used to access the current Square selected before selecting a piece. |
protected Board.LayoutParams |
generateDefaultLayoutParams()
Returns a set of layout parameters with a width of ViewGroup.LayoutParams.MATCH_PARENT,
a height of ViewGroup.LayoutParams.WRAP_CONTENT and no spanning. |
Board.LayoutParams |
generateLayoutParams(AttributeSet attrs)
|
protected Board.LayoutParams |
generateLayoutParams(ViewGroup.LayoutParams p)
|
BoardDisplay |
getBoardDisplay()
|
String |
getGameID()
|
protected Board.Piece[] |
getPieces()
|
static Board.Square |
getSquareAt(int p)
This method accesses the squares container |
void |
initializeGame(boolean normalPlay,
String userName01,
String userName02,
int seconds)
|
static Board |
Instance()
|
static int |
invertPosition(int pos)
|
boolean |
isBackward(int pos)
|
static boolean |
isClient()
|
void |
onClick(View v)
|
protected void |
onLayout(boolean changed,
int left,
int top,
int right,
int bottom)
Accepts and lays out all child views e.g. |
void |
pgnMovement(String movement,
boolean back)
This method is used to access the current pgn move and reset the pieces to their proper state. |
void |
resetBoard()
|
void |
resetBoardOrder()
Resets the z order of all the pieces on the board by looping through each square and by using the method Square.sendPieceToBack, which is an altered version of View.bringToFront(). The method will send the piece to the back by changing the z order |
void |
resetFile()
Resets the z order of all the pieces on the board by looping through each square and by using the method bringPieceToFront, which is an altered version of bringToFront(). The method will bring the piece to the front by changing the z order REFERENCED FROM: http://developer.android.com/reference/android/view/View.html#bringToFront() |
void |
restartToMenu()
|
static void |
setAsClient()
|
static void |
setAsReceivedMove()
|
static void |
setAsRegularMove()
|
protected void |
setTutorialPlayer()
|
protected void |
setTutorialPlayer(Board.Color c)
|
void |
setUpHistory(int size)
|
void |
startActivityForResult(Intent enableIntent,
int requestEnableBt)
|
protected void |
wipeBoard()
|
| Methods inherited from class android.widget.FrameLayout |
|---|
draw, drawableStateChanged, gatherTransparentRegion, getConsiderGoneChildrenWhenMeasuring, getForeground, onMeasure, onSizeChanged, setForeground, setForegroundGravity, setMeasureAllChildren, verifyDrawable |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface us.the.mac.board.TimerCallback |
|---|
onTimerEnded, onTimerUpdate |
| Methods inherited from interface android.view.ViewParent |
|---|
createContextMenu, getParent, isLayoutRequested, requestLayout |
| Field Detail |
|---|
public static boolean STARTED_CONNECTION
public static boolean client
public static boolean moveReceivedFromOpponent
protected Board.Color mPrimaryColor
protected Board.Color mCurrentColor
| Constructor Detail |
|---|
public Board(Context context,
AttributeSet attrs)
context - The Application/Activity contextattrs - The xml attributes passed| Method Detail |
|---|
public void startActivityForResult(Intent enableIntent,
int requestEnableBt)
public void restartToMenu()
public void resetBoard()
public static void setAsReceivedMove()
public static void setAsRegularMove()
public static boolean isClient()
public static int invertPosition(int pos)
public static void setAsClient()
public static Board Instance()
public BoardDisplay getBoardDisplay()
public String convertToFEN()
public void initializeGame(boolean normalPlay,
String userName01,
String userName02,
int seconds)
public void cancelGame()
public String getGameID()
protected void setTutorialPlayer()
protected void setTutorialPlayer(Board.Color c)
protected void onLayout(boolean changed,
int left,
int top,
int right,
int bottom)
onLayout in class FrameLayoutpublic void resetFile()
public void resetBoardOrder()
public static Board.Square getSquareAt(int p)
p - the position of the square to access
#Square that is available, otherwise nullprotected Board.Piece[] getPieces()
protected void currentSelection(int squ)
squ - The currently selected Squareprotected void currentPieceMovement(int squ)
squ - The currently selected Squarepublic void onClick(View v)
onClick in interface View.OnClickListenerprotected void currentSelection(Board.Square squ)
squ - The currently selected Squareprotected void currentPieceMovement(Board.Square squ)
squ - The currently selected Square
public void pgnMovement(String movement,
boolean back)
movement - The currently selected Squarepublic void setUpHistory(int size)
public boolean isBackward(int pos)
protected void wipeBoard()
public Board.LayoutParams generateLayoutParams(AttributeSet attrs)
generateLayoutParams in class FrameLayoutprotected Board.LayoutParams generateDefaultLayoutParams()
ViewGroup.LayoutParams.MATCH_PARENT,
a height of ViewGroup.LayoutParams.WRAP_CONTENT and no spanning.
generateDefaultLayoutParams in class FrameLayoutprotected boolean checkLayoutParams(ViewGroup.LayoutParams p)
checkLayoutParams in class FrameLayoutprotected Board.LayoutParams generateLayoutParams(ViewGroup.LayoutParams p)
generateLayoutParams in class FrameLayout
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||