Cogs.Core
Public Member Functions | Public Attributes | List of all members
Cogs::Core::FieldValue Struct Reference

Defines a value to apply to a field. More...

#include <EntityDefinition.h>

Public Member Functions

 FieldValue (const FieldValue &original)
 
const MaterialInstanceDefinitionasMaterialInstance () const
 
FieldValueoperator= (const FieldValue &rhs)
 

Public Attributes

Reflection::TypeId componentId = Reflection::NoType
 Type id of the component the value should be applied to.
 
Reflection::FieldId fieldId = Reflection::NoField
 Field id of the field in the given component the value should be applied to.
 
DefaultValueType type = DefaultValueType::Unknown
 Type of the field.
 
union {
   bool   boolValue
 
   float   floatValue
 
   double   doubleValue
 
   int   intValue
 
   glm::vec2   float2
 
   glm::vec3   float3
 
   glm::vec4   float4
 
   glm::quat   quat
 
   glm::dvec2   double2
 
   glm::dvec3   double3
 
   glm::dvec4   double4
 
   glm::mat4x4   mat4
 
   char   storage [512] = { 0 }
 
}; 
 
std::string value
 
std::vector< std::string > values
 
std::vector< int > intValues
 
std::vector< float > floatValues
 
std::vector< glm::vec3 > vec3Values
 
std::vector< glm::vec2 > vec2Values
 
std::vector< glm::vec4 > vec4Values
 

Detailed Description

Defines a value to apply to a field.

The value is a variant type, using a type field to determine the type at runtime.

Definition at line 75 of file EntityDefinition.h.

Constructor & Destructor Documentation

◆ FieldValue() [1/2]

Cogs::Core::FieldValue::FieldValue ( )
inline

Definition at line 77 of file EntityDefinition.h.

◆ FieldValue() [2/2]

Cogs::Core::FieldValue::FieldValue ( const FieldValue original)
inline

Definition at line 79 of file EntityDefinition.h.

Member Function Documentation

◆ asMaterialInstance()

const MaterialInstanceDefinition * Cogs::Core::FieldValue::asMaterialInstance ( ) const
inline

Definition at line 134 of file EntityDefinition.h.

◆ operator=()

FieldValue & Cogs::Core::FieldValue::operator= ( const FieldValue rhs)
inline

Definition at line 136 of file EntityDefinition.h.

Member Data Documentation

◆ boolValue

bool Cogs::Core::FieldValue::boolValue

Definition at line 106 of file EntityDefinition.h.

◆ componentId

Reflection::TypeId Cogs::Core::FieldValue::componentId = Reflection::NoType

Type id of the component the value should be applied to.

Definition at line 96 of file EntityDefinition.h.

◆ double2

glm::dvec2 Cogs::Core::FieldValue::double2

Definition at line 114 of file EntityDefinition.h.

◆ double3

glm::dvec3 Cogs::Core::FieldValue::double3

Definition at line 115 of file EntityDefinition.h.

◆ double4

glm::dvec4 Cogs::Core::FieldValue::double4

Definition at line 116 of file EntityDefinition.h.

◆ doubleValue

double Cogs::Core::FieldValue::doubleValue

Definition at line 108 of file EntityDefinition.h.

◆ fieldId

Reflection::FieldId Cogs::Core::FieldValue::fieldId = Reflection::NoField

Field id of the field in the given component the value should be applied to.

Definition at line 99 of file EntityDefinition.h.

◆ float2

glm::vec2 Cogs::Core::FieldValue::float2

Definition at line 110 of file EntityDefinition.h.

◆ float3

glm::vec3 Cogs::Core::FieldValue::float3

Definition at line 111 of file EntityDefinition.h.

◆ float4

glm::vec4 Cogs::Core::FieldValue::float4

Definition at line 112 of file EntityDefinition.h.

◆ floatValue

float Cogs::Core::FieldValue::floatValue

Definition at line 107 of file EntityDefinition.h.

◆ floatValues

std::vector<float> Cogs::Core::FieldValue::floatValues

Definition at line 129 of file EntityDefinition.h.

◆ intValue

int Cogs::Core::FieldValue::intValue

Definition at line 109 of file EntityDefinition.h.

◆ intValues

std::vector<int> Cogs::Core::FieldValue::intValues

Definition at line 128 of file EntityDefinition.h.

◆ mat4

glm::mat4x4 Cogs::Core::FieldValue::mat4

Definition at line 117 of file EntityDefinition.h.

◆ quat

glm::quat Cogs::Core::FieldValue::quat

Definition at line 113 of file EntityDefinition.h.

◆ storage

char Cogs::Core::FieldValue::storage[512] = { 0 }

Definition at line 122 of file EntityDefinition.h.

◆ type

DefaultValueType Cogs::Core::FieldValue::type = DefaultValueType::Unknown

Type of the field.

Definition at line 102 of file EntityDefinition.h.

◆ value

std::string Cogs::Core::FieldValue::value

Definition at line 126 of file EntityDefinition.h.

◆ values

std::vector<std::string> Cogs::Core::FieldValue::values

Definition at line 127 of file EntityDefinition.h.

◆ vec2Values

std::vector<glm::vec2> Cogs::Core::FieldValue::vec2Values

Definition at line 131 of file EntityDefinition.h.

◆ vec3Values

std::vector<glm::vec3> Cogs::Core::FieldValue::vec3Values

Definition at line 130 of file EntityDefinition.h.

◆ vec4Values

std::vector<glm::vec4> Cogs::Core::FieldValue::vec4Values

Definition at line 132 of file EntityDefinition.h.


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