using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace IPA.Config.Data { /// /// A representing a piece of text. The only reason this is not named /// String is so that it doesn't conflict with . /// public sealed class Text : Value { /// /// The actual value of this object. /// public string Value { get; set; } /// /// Converts this into a human-readable format. /// /// a quoted, unescaped string form of public override string ToString() => $"\"{Value}\""; } /// /// A representing an integer. This may hold a 's /// worth of data. /// public sealed class Integer : Value { /// /// The actual value of the object. /// public long Value { get; set; } /// /// Coerces this into a . /// /// a representing the closest approximation of public FloatingPoint AsFloat() => Float(Value); /// /// Converts this into a human-readable format. /// /// the result of Value.ToString() public override string ToString() => Value.ToString(); } /// /// A representing a floating point value. This may hold a /// 's worth of data. /// public sealed class FloatingPoint : Value { /// /// The actual value fo this object. /// public decimal Value { get; set; } /// /// Coerces this into an . /// /// a representing the closest approximation of public Integer AsInteger() => Integer((long)Value); /// /// Converts this into a human-readable format. /// /// the result of Value.ToString() public override string ToString() => Value.ToString(); } /// /// A representing a boolean value. /// public sealed class Boolean : Value { /// /// The actual value fo this object. /// public bool Value { get; set; } /// /// Converts this into a human-readable format. /// /// the result of Value.ToString().ToLower() public override string ToString() => Value.ToString().ToLower(); } }