Class SGFParser

java.lang.Object
featurecat.lizzie.rules.SGFParser

public class SGFParser extends Object
  • Constructor Details

    • SGFParser

      public SGFParser()
  • Method Details

    • load

      public static boolean load(String filename) throws IOException
      Throws:
      IOException
    • loadFromString

      public static boolean loadFromString(String sgfString)
    • passPos

      public static String passPos()
    • isPassPos

      public static boolean isPassPos(String pos)
    • convertSgfPosToCoord

      public static int[] convertSgfPosToCoord(String pos)
    • saveToString

      public static String saveToString() throws IOException
      Throws:
      IOException
    • save

      public static void save(Board board, String filename) throws IOException
      Throws:
      IOException
    • isListProperty

      public static boolean isListProperty(String key)
    • isMarkupProperty

      public static boolean isMarkupProperty(String key)
    • getOrDefault

      public static String getOrDefault(Map<String,String> props, String key, String defaultValue)
      Get a value with key, or the default if there is no such key
      Parameters:
      key -
      defaultValue -
      Returns:
    • addProperty

      public static void addProperty(Map<String,String> props, String key, String value)
      Add a key and value to the props
      Parameters:
      key -
      value -
    • addProperties

      public static void addProperties(Map<String,String> props, Map<String,String> addProps)
      Add the properties by mutating the props
    • addProperties

      public static void addProperties(Map<String,String> props, String propsStr)
      Add the properties from string
    • propertiesString

      public static String propertiesString(Map<String,String> props)
      Get properties string by the props
      Returns:
    • nodeString

      public static String nodeString(String key, String value)
      Get node string by the key and value
      Parameters:
      key -
      value -
      Returns:
    • Escaping

      public static String Escaping(String in)
    • parseSgf

      public static BoardHistoryList parseSgf(String value)
    • parseBranch

      public static int parseBranch(BoardHistoryList history, String value)