Skip to content
Snippets Groups Projects
Commit ff1ab968 authored by Jiří Kalvoda's avatar Jiří Kalvoda
Browse files

ConfigParser: AsDouble

parent 7ef9ada1
No related branches found
No related tags found
No related merge requests found
......@@ -190,6 +190,16 @@ class ConfigValue
throw new ConfigParseAttributeException(this, "String is not color");
}
}
public double AsDouble()
{
try
{
return double.Parse(AsString());
} catch (ArgumentException)
{
throw new ConfigParseAttributeException(this, "String is not color");
}
}
public static implicit operator string(ConfigValue v) => v.AsString();
internal ConfigValue(ConfigSection _Section, string _Key, int _line)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment