Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using UnityEditor.AnimatedValues;

namespace Fluctio.FluctioSim.EditorUtils.SettingsManagement.Table
{
	[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
	[SuppressMessage("ReSharper", "UnusedMember.Global")]
	[SuppressMessage("ReSharper", "UnusedMethodReturnValue.Global")]
	public record TableDefinition<TLabel, TInfo>(
		bool IsFoldout,
		string Title,
		Dictionary<string, TableRowDefinition<TLabel, TInfo>> Rows,
		Action DrawHeader,
		Action<TLabel, TInfo, string> DrawRow,
		bool DoesFoldoutStartOpen = true)
	{
		public TableValues<TInfo> GetDefaults()
		{
			var defaultValues = new TableValues<TInfo>();
			foreach (var (rowKey, rowDefinition) in Rows)
			{
				defaultValues.Dictionary[rowKey] = rowDefinition.DefaultInfo;
			}
			defaultValues.foldoutState = new AnimBool(DoesFoldoutStartOpen);
			return defaultValues;
		}
	}
	
	public record TableRowDefinition<TLabel, TInfo>(TLabel Label, TInfo DefaultInfo);
}