Files
Brandyn / Techy fcc1b09210 init
2026-04-04 15:40:51 -05:00

74 lines
1.0 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "MuT/Table.h"
#include "MuR/MutableMath.h"
namespace UE::Mutable::Private
{
MUTABLE_DEFINE_ENUM_SERIALISABLE(ETableColumnType)
struct FTableColumn
{
FString Name;
ETableColumnType Type;
};
struct FTableValue
{
// TODO: Union
int32 Int;
float Scalar;
FVector4f Color;
Ptr<TResourceProxy<FImage>> ProxyImage;
TSharedPtr<FMesh> Mesh;
FString String;
const void* ErrorContext;
};
struct FTableRow
{
uint32 Id;
TArray<FTableValue> Values;
};
//!
class FTable::Private
{
public:
FString Name;
TArray<FTableColumn> Columns;
TArray<FTableRow> Rows;
// Transient value for serialization compatibility
bool bNoneOption_DEPRECATED = false;
//! Find a row in the table by id. Return -1 if not found.
int32 FindRow( uint32 id ) const
{
int32 res = -1;
for ( int32 r=0; res<0 && r<Rows.Num(); ++r )
{
if ( Rows[r].Id==id )
{
res = (int32)r;
}
}
return res;
}
};
}