Bicameral Engine
GPU-resident engine for a magic-research open-world game
Loading...
Searching...
No Matches
bicameral::script::ScriptValue Struct Reference

#include <script_value.h>

Public Types

enum class  Kind : uint8_t {
  Nil , Boolean , Number , String ,
  Table
}

Public Member Functions

bool IsTable () const
bool IsString () const
bool IsNumber () const
const ScriptValue * Find (std::string_view key) const

Static Public Member Functions

static ScriptValue MakeBoolean (bool value)
static ScriptValue MakeNumber (double value)
static ScriptValue MakeString (std::string value)
static ScriptValue MakeTable (std::vector< ScriptField > fields)

Public Attributes

Kind kind = Kind::Nil
bool boolean = false
double number = 0.0
std::string text
std::vector< ScriptField > fields

Detailed Description

Definition at line 19 of file script_value.h.

Member Enumeration Documentation

◆ Kind

enum class bicameral::script::ScriptValue::Kind : uint8_t
strong
Enumerator
Nil 
Boolean 
Number 
String 
Table 

Definition at line 20 of file script_value.h.

Member Function Documentation

◆ Find()

const ScriptValue * bicameral::script::ScriptValue::Find ( std::string_view key) const
nodiscard

Definition at line 64 of file script_value.cpp.

References fields, and String.

Referenced by bicameral::script::anonymous_namespace{reaction_package.cpp}::ReadRule(), bicameral::script::anonymous_namespace{reaction_package.cpp}::ReadRuleTerms(), and bicameral::script::anonymous_namespace{reaction_package.cpp}::RequireField().

Here is the caller graph for this function:

◆ IsNumber()

bool bicameral::script::ScriptValue::IsNumber ( ) const
inlinenodiscard

Definition at line 43 of file script_value.h.

References kind, and Number.

Referenced by bicameral::script::anonymous_namespace{luau_package.cpp}::ParseManifest(), bicameral::script::anonymous_namespace{reaction_package.cpp}::ReadInteger(), and bicameral::script::anonymous_namespace{luau_package.cpp}::ReadNameList().

Here is the caller graph for this function:

◆ IsString()

◆ IsTable()

bool bicameral::script::ScriptValue::IsTable ( ) const
inlinenodiscard

Definition at line 41 of file script_value.h.

References kind, and Table.

Referenced by bicameral::script::anonymous_namespace{luau_package.cpp}::ParseManifest(), bicameral::script::anonymous_namespace{luau_package.cpp}::ReadNameList(), and bicameral::script::anonymous_namespace{reaction_package.cpp}::RequireTable().

Here is the caller graph for this function:

◆ MakeBoolean()

ScriptValue bicameral::script::ScriptValue::MakeBoolean ( bool value)
staticnodiscard

Definition at line 27 of file script_value.cpp.

References Boolean, boolean, and kind.

Referenced by bicameral::script::anonymous_namespace{luau_sandbox.cpp}::ReadValue().

Here is the caller graph for this function:

◆ MakeNumber()

ScriptValue bicameral::script::ScriptValue::MakeNumber ( double value)
staticnodiscard

Definition at line 35 of file script_value.cpp.

References kind, Number, and number.

Referenced by bicameral::script::anonymous_namespace{luau_sandbox.cpp}::ReadKey(), and bicameral::script::anonymous_namespace{luau_sandbox.cpp}::ReadValue().

Here is the caller graph for this function:

◆ MakeString()

ScriptValue bicameral::script::ScriptValue::MakeString ( std::string value)
staticnodiscard

Definition at line 43 of file script_value.cpp.

References kind, String, and text.

Referenced by bicameral::script::anonymous_namespace{luau_sandbox.cpp}::ReadKey().

Here is the caller graph for this function:

◆ MakeTable()

ScriptValue bicameral::script::ScriptValue::MakeTable ( std::vector< ScriptField > fields)
staticnodiscard

Definition at line 51 of file script_value.cpp.

References fields, bicameral::script::ScriptField::key, bicameral::script::KeyLess(), kind, and Table.

Referenced by bicameral::script::anonymous_namespace{luau_sandbox.cpp}::ReadTable().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ boolean

bool bicameral::script::ScriptValue::boolean = false

◆ fields

◆ kind

◆ number

◆ text


The documentation for this struct was generated from the following files: