mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
LuaState tovalue, pushvalue for dynamic::Value
This commit is contained in:
parent
8950f4ecd5
commit
75a7b89fc8
9 changed files with 126 additions and 31 deletions
|
|
@ -353,6 +353,10 @@ Value::~Value() {
|
|||
}
|
||||
}
|
||||
|
||||
Value Value::of(bool value) {
|
||||
return Value(valtype::boolean, value);
|
||||
}
|
||||
|
||||
Value Value::of(number_u value) {
|
||||
if (std::holds_alternative<integer_t>(value)) {
|
||||
return Value(valtype::integer, std::get<integer_t>(value));
|
||||
|
|
@ -360,3 +364,7 @@ Value Value::of(number_u value) {
|
|||
return Value(valtype::number, std::get<number_t>(value));
|
||||
}
|
||||
}
|
||||
|
||||
Value Value::of(const std::string& value) {
|
||||
return Value(valtype::string, value);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue