51 lines
961 B
C++
51 lines
961 B
C++
/***
|
|
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
File: Value.hpp
|
|
Date: 2021-10-24
|
|
Author: Reece
|
|
***/
|
|
#pragma once
|
|
|
|
namespace Aurora::Data
|
|
{
|
|
struct Value
|
|
{
|
|
#define CONSTRUCTOR(type, member)\
|
|
Value(type val)\
|
|
{\
|
|
primitive.member = val;\
|
|
}
|
|
CONSTRUCTOR(const AuVec3 &, vec3);
|
|
CONSTRUCTOR(const AuVec4 &, vec4);
|
|
CONSTRUCTOR(bool, boolean);
|
|
CONSTRUCTOR(double, number);
|
|
CONSTRUCTOR(AuInt64, sint);
|
|
CONSTRUCTOR(AuUInt64, uint);
|
|
#undef CONSTRUCTOR
|
|
|
|
Value(uuids::uuid val)
|
|
{
|
|
UUID = val;
|
|
}
|
|
|
|
Value(const AuString &val)
|
|
{
|
|
string = val;
|
|
}
|
|
|
|
Value(const char *val)
|
|
{
|
|
string = val;
|
|
}
|
|
|
|
Value()
|
|
{
|
|
|
|
}
|
|
|
|
PrimitiveValue primitive;
|
|
uuids::uuid UUID;
|
|
AuString string;
|
|
};
|
|
} |