AuroraRuntime/Include/Aurora/Data/Value.hpp

53 lines
991 B
C++
Raw Normal View History

/***
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
{
AU_COPY_MOVE(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;
};
}