using CSMic;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CSMic
{
/// An encapsulated function value.
public class FunctionValue
{
#region Properties
/// Gets or sets the value type of a function.
/// The type.
public FunctionValueType Type { get; set; }
/// Gets or sets the value.
/// The value.
public object? Value { get; set; }
#endregion
#region Constants
///
/// (Immutable) A defined that represents a true
/// whose value is 1.
///
public static readonly FunctionValue TRUE = new FunctionValue(FunctionValueType.Numeric, 1m);
///
/// (Immutable) A defined that represents a false
/// whose value is 0.
///
public static readonly FunctionValue FALSE = new FunctionValue(FunctionValueType.Numeric, 0m);
///
/// (Immutable) A defined that represents a undefined value.
///
public static readonly FunctionValue NONE = new FunctionValue(FunctionValueType.None, null);
///
/// (Immutable) A defined that represents a numeric value. The
/// default value is 0.
///
public static readonly FunctionValue NUMBER = new FunctionValue(FunctionValueType.Numeric, 0m);
///
/// (Immutable) A defined that represents a string value. The default
/// value is .
///
public static readonly FunctionValue STRING = new FunctionValue(FunctionValueType.String, string.Empty);
///
/// (Immutable) A defined that represents the number zero.
///
public static readonly FunctionValue ZERO = new FunctionValue(FunctionValueType.Numeric, 0m);
#endregion
#region Constructors
/// Default constructor.
public FunctionValue()
{
this.Type = FunctionValueType.None;
this.Value = null;
}
/// Constructor.
/// The type.
/// The value.
public FunctionValue(FunctionValueType type, object? value)
{
this.Type = type;
this.Value = value;
}
#endregion
}
}