Package org.kaminoite.ranka.kido.ipad.tools.go.specification.structure

Examples of org.kaminoite.ranka.kido.ipad.tools.go.specification.structure.GameInfo


    /** Create a game tree with the current board position as setup stones. */
    public static GameTree makeTreeFromPosition(ConstGameInfo info,
                                                ConstBoard board)
    {
        if (info == null)
            info = new GameInfo();
        GameTree tree = new GameTree(board.getSize(), info.getKomi(), null,
                                     info.get(StringInfo.RULES),
                                     info.getTimeSettings());
        Node root = tree.getRoot();
        for (GoPoint p : board)
View Full Code Here


  private final Map<String, ArrayList<String>> m_props = new TreeMap<String, ArrayList<String>> ();

  /** Apply some fixes for broken SGF files. */
  private void applyFixes () {
    Node root = m_tree.getRoot ();
    GameInfo info = m_tree.getGameInfo (root);
    if (root.hasSetup () && root.getPlayer () == null)
    {
      if (info.getHandicap () > 0)
      {
        root.setPlayer (WHITE);
      }
      else
      {
View Full Code Here

    }
    return m_buffer.toString ();
  }

  private void set (Node node, StringInfo type, String value) {
    GameInfo info = createGameInfo (node);
    info.set (type, value);
  }
View Full Code Here

    GameInfo info = createGameInfo (node);
    info.set (type, value);
  }

  private void set (Node node, StringInfoColor type, GoColor c, String value) {
    GameInfo info = createGameInfo (node);
    info.set (type, c, value);
  }
View Full Code Here

    public GameTree(int boardSize, Komi komi, ConstPointList handicap,
                    String rules, TimeSettings timeSettings)
    {
        m_boardSize = boardSize;
        m_root = new Node();
        GameInfo info = m_root.createGameInfo();
        setDate();
        info.setKomi(komi);
        info.set(StringInfo.RULES, rules);
        if (timeSettings != null)
            info.setTimeSettings(timeSettings);
        if (handicap != null)
        {
            info.setHandicap(handicap.size());
            if (handicap.size() > 0)
            {
                m_root.addStones(BLACK, handicap);
                m_root.setPlayer(WHITE);
            }
View Full Code Here

        Calendar cal = Calendar.getInstance();
        int year = cal.get(Calendar.YEAR);
        int month = cal.get(Calendar.MONTH) + 1;
        int day = cal.get(Calendar.DAY_OF_MONTH);
        DecimalFormat format = new DecimalFormat("00");
        GameInfo info = m_root.getGameInfo();
        info.set(StringInfo.DATE,
                 Integer.toString(year) + "-" + format.format(month) + "-"
                 + format.format(day));
    }
View Full Code Here

TOP

Related Classes of org.kaminoite.ranka.kido.ipad.tools.go.specification.structure.GameInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.