// Copyright (c) 2024 Codemongous LLC. All Rights Reserved.

#pragma once

#include "ISCW_UDataTable.h"
#include "ISCW_UScriptStruct.h"
#include "SCW_UObject.h"

class UDataTable;

namespace Sourcify
{
	class SCW_UDataTable : public SCW_UObject, public virtual ISCW_UDataTable
	{
	public:
		SCW_UDataTable(UDataTable* InDataTable);

		UDataTable* ToUDataTable() const;

		ISCW_UDataTablePtr ToUDataTablePtr() override;
		ISCW_UDataTableConstPtr ToUDataTablePtr() const override;

		vector<wstring> CreateTableFromCSVString(const wstring& csvString) override;

		void EmptyTable() override;

		wstring GetTableAsCSV() const override;

		ISCW_UScriptStructPtr GetRowStruct() const override;

		void SetRowStruct(ISCW_UScriptStructPtr rowStruct) override;

		void HandleDataTableChanged() override;

	protected:
		UDataTable* DataTable;
	};
} // namespace Sourcify