mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 11:31:49 +00:00
add src/coders/obj
This commit is contained in:
parent
a9640fff36
commit
e4f9bd03b7
11 changed files with 241 additions and 28 deletions
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include "../typedefs.hpp"
|
||||
|
||||
#include <cmath>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
|
|
@ -47,6 +48,15 @@ namespace dynamic {
|
|||
std::holds_alternative<integer_t>(value);
|
||||
}
|
||||
|
||||
inline number_t as_number(const Value& value) {
|
||||
if (auto num = std::get_if<number_t>(&value)) {
|
||||
return *num;
|
||||
} else if (auto num = std::get_if<integer_t>(&value)) {
|
||||
return *num;
|
||||
}
|
||||
return NAN;
|
||||
}
|
||||
|
||||
class List {
|
||||
public:
|
||||
std::vector<Value> values;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue