Skip to content

Commit

Permalink
Add DataDrivenExecutableLibrary
Browse files Browse the repository at this point in the history
  • Loading branch information
AkiKurisu committed Jan 27, 2025
1 parent 4483e4d commit 1683d62
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Runtime/Flow/Utilities/Libraries/CeresExecutableLibrary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace Ceres.Graph.Flow.Utilities
{
/// <summary>
/// Executable function library for ceres
/// Executable function library for CeresAPI
/// </summary>
[CeresGroup("Ceres")]
public partial class CeresExecutableLibrary: ExecutableFunctionLibrary
Expand Down
47 changes: 47 additions & 0 deletions Runtime/Flow/Utilities/Libraries/DataDrivenExecutableLibrary.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
using Ceres.Annotations;
using Ceres.Graph.Flow.Annotations;
using Chris.DataDriven;
using Chris.Serialization;

namespace Ceres.Graph.Flow.Utilities
{
/// <summary>
/// Executable function library for Chris.DataDriven
/// </summary>
[CeresGroup("DataDriven")]
public partial class DataDrivenExecutableLibrary: ExecutableFunctionLibrary
{
[ExecutableFunction]
public static DataTableManager Flow_GetDataTableManager(
[ResolveReturn] SerializedType<DataTableManager> managerType)
{
return DataTableManager.GetOrCreateDataTableManager(managerType);
}

[ExecutableFunction(IsScriptMethod = true), CeresLabel("Get DataTable")]
public static DataTable Flow_DataTableManagerGetDataTable(DataTableManager dataTableManager, string name)
{
return dataTableManager.GetDataTable(name);
}

[ExecutableFunction(IsScriptMethod = true), CeresLabel("Get Row")]
public static IDataTableRow Flow_DataTableGetRow(DataTable dataTable, string rowId,
[ResolveReturn] SerializedType<IDataTableRow> rowType)
{
return dataTable.GetRow(rowId);
}

[ExecutableFunction(IsScriptMethod = true), CeresLabel("Get Row by Index")]
public static IDataTableRow Flow_DataTableGetRowByIndex(DataTable dataTable, int index,
[ResolveReturn] SerializedType<IDataTableRow> rowType)
{
return dataTable.GetRow(index);
}

[ExecutableFunction(IsScriptMethod = true), CeresLabel("Get All Rows")]
public static IDataTableRow[] Flow_DataTableGetAllRows(DataTable dataTable)
{
return dataTable.GetAllRows();
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1683d62

Please sign in to comment.