Search in sources :

Example 1 with ParserContext

use of pl.themolka.arcade.parser.ParserContext in project Arcade2 by ShootGame.

the class SimpleGameManager method setDefaultMaxGameId.

@Override
public void setDefaultMaxGameId() {
    Node node = this.plugin.getSettings().getData().child("queue");
    if (node == null) {
        return;
    }
    try {
        ParserContext context = this.plugin.getParsers().createContext();
        this.setMaxGameId(context.type(Integer.class).parse(node.property("restart-after")).orFail());
    } catch (ParserNotSupportedException | ParserException ex) {
        ex.printStackTrace();
    }
}
Also used : ParserException(pl.themolka.arcade.parser.ParserException) Node(pl.themolka.arcade.dom.Node) ParserContext(pl.themolka.arcade.parser.ParserContext) ParserNotSupportedException(pl.themolka.arcade.parser.ParserNotSupportedException)

Aggregations

Node (pl.themolka.arcade.dom.Node)1 ParserContext (pl.themolka.arcade.parser.ParserContext)1 ParserException (pl.themolka.arcade.parser.ParserException)1 ParserNotSupportedException (pl.themolka.arcade.parser.ParserNotSupportedException)1