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 GameHistory

    java.lang.Object
      vutbr.checkers.game.GameHistory

    public class GameHistory

extends java.lang.Object

Historie tahu

Author:
  Ondrej Choleva , Ondrej Novy

Constructor Summary
`GameHistory(Game game)` konstruktor

Method Summary
`Game` | `getGame()` Vrati aktualni hru
`Game.GameColor` | `getMyColor()` Vrati barvu hrace
`java.lang.String` | `getOpponent()` Vrati jmeno protihrace
`int` | `getTurnNumber()` Vrati cislo tahu
`void` | `load()` Nacte soubor historie
`boolean` | `replayTurnBack()` Nastavi sachovnici podle tahu predeneho v turn smerem dozadu Pokud neexistuje zadny predchozi tah, vraci false
`boolean` | `replayTurnForw()` Nastavi sachovnici podle tahu predeneho v turn smerem dopredu Pokud neexistuje zadny nasledujici tah, vraci false
`void` | `save()` Ulozi soubor historie
`void` | `setHistoryFile(java.lang.String historyFile)` Nastavi jmeno souboru historie
`protected void` | `setChangedToKing()` Nastavi priznak zmeny na damu
`void` | `setMyColor(Game.GameColor myColor)` Nastavi barvu hrace
`void` | `setOpponent(java.lang.String opponent)` Nastavi jmeno protihrace
`protected void` | `setRemoved(int x, int y, GamePiece piece)` Nastavi vyhozenou figurku
`protected void` | `turn(int x, int y, int toX, int toY)` Ulozi tah
`protected void` | `turnEnd()` Ulozi konec tahu

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

Constructor Detail

### GameHistory

    public GameHistory(Game game)

  konstruktor

  Parameters:
    `game` - Hra

Method Detail

### turn

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

  Ulozi tah

  Parameters:
    `x` - Vychozi souradnice x
    `y` - Vychozi souradnice y
    `toX` - Cilova souradnice x
    `toY` - Cilova souradnice y

### turnEnd

    protected void turnEnd()

  Ulozi konec tahu

### replayTurnForw

    public boolean replayTurnForw()

  Nastavi sachovnici podle tahu predeneho v turn smerem dopredu Pokud neexistuje zadny nasledujici tah, vraci false

  Returns:
    True, false

### replayTurnBack

    public boolean replayTurnBack()

  Nastavi sachovnici podle tahu predeneho v turn smerem dozadu Pokud neexistuje zadny predchozi tah, vraci false

  Returns:
    True, false

### setRemoved

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

  Nastavi vyhozenou figurku

  Parameters:
    `x` - Souradnice X vyhozene firuky
    `y` - Souradnice Y vyhozene figurky
    `piece` - Typ vyhozene figurky

### setChangedToKing

    protected void setChangedToKing()

  Nastavi priznak zmeny na damu

### load

    public void load()

  Nacte soubor historie

### save

    public void save()

  Ulozi soubor historie

### setHistoryFile

    public void setHistoryFile(java.lang.String historyFile)

  Nastavi jmeno souboru historie

  Parameters:
    `historyFile` - Jmeno souboru s historii

### setOpponent

    public void setOpponent(java.lang.String opponent)

  Nastavi jmeno protihrace

  Parameters:
    `opponent` - Jmeno protihrace

### getOpponent

    public java.lang.String getOpponent()

  Vrati jmeno protihrace

  Returns:
    Jmeno protihrace

### getGame

    public Game getGame()

  Vrati aktualni hru

  Returns:
    Aktualni hra

### getTurnNumber

    public int getTurnNumber()

  Vrati cislo tahu

  Returns:
    Cislo tahu

### setMyColor

    public void setMyColor(Game.GameColor myColor)

  Nastavi barvu hrace

  Parameters:
    `myColor` - Barva

### getMyColor

    public Game.GameColor getMyColor()

  Vrati barvu hrace

  Returns:
    Barva

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