Class BoolValue
Represents a boolean value in the virtual machine, implementing the IValue interface.
Implements
Inherited Members
Namespace: VM.Core.ValueTypes
Assembly: VM.dll
Syntax
public class BoolValue : IValue
Remarks
Encapsulates a boolean value and provides type conversion methods to other primitive types.
Constructors
BoolValue(bool)
Represents a boolean value in the virtual machine, implementing the IValue interface.
Declaration
public BoolValue(bool value)
Parameters
Type | Name | Description |
---|---|---|
bool | value |
Remarks
Encapsulates a boolean value and provides type conversion methods to other primitive types.
Properties
Raw
Gets the raw boolean value as an object.
Declaration
public object Raw { get; }
Property Value
Type | Description |
---|---|
object |
TypeName
Gets the type name of this value ("bool").
Declaration
public string TypeName { get; }
Property Value
Type | Description |
---|---|
string |
Value
Gets the underlying boolean value.
Declaration
public bool Value { get; }
Property Value
Type | Description |
---|---|
bool |
Methods
AsBool()
Returns the boolean value directly.
Declaration
public bool AsBool()
Returns
Type | Description |
---|---|
bool | The underlying boolean value. |
AsFloat()
Converts the boolean value to a float (1.0 for true, 0.0 for false).
Declaration
public float AsFloat()
Returns
Type | Description |
---|---|
float | 1.0 if true; otherwise 0.0. |
AsInt()
Converts the boolean value to an integer (1 for true, 0 for false).
Declaration
public int AsInt()
Returns
Type | Description |
---|---|
int | 1 if true; otherwise 0. |
AsString()
Converts the boolean value to a string ("true" or "false").
Declaration
public string AsString()
Returns
Type | Description |
---|---|
string | "true" if true; otherwise "false". |
ToString()
Returns a string representation of the boolean value.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | "true" if true; otherwise "false". |