Example #1
0
  private void setModel(GameModel gameModel) {
    m_model = gameModel;
    m_header = gameModel.getHeaderModel();
    m_moves = gameModel.getMoveModel();

    String fen = m_header.getTag(PGN.TAG_FEN);
    if (fen != null) {
      setPosition(new Position(fen, false));
    } else {
      setPosition(Position.createInitialPosition());
    }
  }
Example #2
0
 /**
  * Returns a string represention of the game. Implemented as the string represention of the header
  * plus the move model.
  *
  * @return a string represention of the game
  */
 public String toString() {
   return m_model.toString();
 }
Example #3
0
 //    public void load(DataInput in, int headerMode, int movesMode) throws IOException
 //    {
 //        m_header = new ChGameHeaderModel(in, headerMode);
 //        m_moves = new ChGameMoveModel(in, movesMode);
 //    }
 //
 public void save(DataOutput out, int headerMode, int movesMode) throws IOException {
   m_model.save(out, headerMode, movesMode);
 }