Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## vutbr.checkers.game
Class GameBoard

    java.lang.Object
      vutbr.checkers.game.GameBoard

    public class GameBoard

extends java.lang.Object

Trida GameBoard - hraci plocha

Author:
  Ondrej Novy

Constructor Summary
`GameBoard(GameHistory gameHistory)` Konstruktor

Method Summary
`protected void` | `addPiece(int x, int y, GamePiece piece)` Prida figurku do hraciho pole
`protected GameHistory` | `getGameHistory()` Vrati historii hry
`GamePiece` | `getPiece(int x, int y)` Vrati figurku na souradnicich
`boolean` | `isGameEnd()` Je konec hry?
`protected void` | `movePiece(int x, int y, int toX, int toY)` Presune figurku z pole jine pole
`protected void` | `removePiece(int x, int y)` Odstrani figurku z pole
`protected void` | `switchPiece(int x, int y, GamePiece newPiece)` Vymeni figurku v poli za jinou
`protected boolean` | `turn(int x, int y, int toX, int toY, GameTurnState gameTurnState)` Provede tah figurkou

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### GameBoard

    public GameBoard(GameHistory gameHistory)

  Konstruktor

Method Detail

### getGameHistory

    protected GameHistory getGameHistory()

  Vrati historii hry

  Returns:
    Historie hry

### addPiece

    protected void addPiece(int x,
                            int y,
                            GamePiece piece)

  Prida figurku do hraciho pole

  Parameters:
    `x` - Souradnice X
    `y` - Souradnice Y
    `piece` - Figurka

### getPiece

    public GamePiece getPiece(int x,
                              int y)

  Vrati figurku na souradnicich

  Parameters:
    `x` - Souradnice X
    `y` - Souradnice Y
  Returns:
    Figurka

### movePiece

    protected void movePiece(int x,
                             int y,
                             int toX,
                             int toY)

  Presune figurku z pole jine pole

  Parameters:
    `x` - Zdrojova souradnice X
    `y` - Zdrojova souradnice Y
    `toX` - Cilova souradnice X
    `toY` - Cilova souradnice Y

### removePiece

    protected void removePiece(int x,
                               int y)

  Odstrani figurku z pole

  Parameters:
    `x` - Souradnice X
    `y` - Souradnice Y

### switchPiece

    protected void switchPiece(int x,
                               int y,
                               GamePiece newPiece)

  Vymeni figurku v poli za jinou

  Parameters:
    `x` - Souradnice X
    `y` - Souradnice Y
    `newPiece` - Nova figurka

### turn

    protected boolean turn(int x,
                           int y,
                           int toX,
                           int toY,
                           GameTurnState gameTurnState)

  Provede tah figurkou

  Parameters:
    `x` - Zdrojova souradnice X
    `y` - Zdrojova souradnice Y
    `toX` - Cilova souradnice X
    `toY` - Cilova souradnice Y
    `gameTurnState` - Stav tahu hry
  Returns:
    True pokud se tah povedl

### isGameEnd

    public boolean isGameEnd()

  Je konec hry?

  Returns:
    Konec hry

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD