All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.republicate.smartlib.sgf.properties.GN Maven / Gradle / Ivy

The newest version!
package com.republicate.smartlib.sgf.properties;

import com.republicate.smartlib.sgf.InfoProperty;
import com.republicate.smartlib.sgf.types.ValueType;
import com.republicate.smartlib.sgf.types.ValueTypes;
import com.republicate.smartlib.sgf.types.SimpleText;

import java.util.List;

/**
 * Provides a name for the game.
 */
public class GN extends InfoProperty {

    private String game = null;

    public ValueType getValueType() {
        return ValueTypes.SIMPLE_TEXT;
    }

    public boolean addValue(List value) {
        if(value.size() != 1) return false;
        game = SimpleText.unescape(value.get(0));
        return true;
    }

    public Object getSGFValue() {
        return SimpleText.escape(game);
    }

    public String getGame() {
        return game;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy