Aetheria/Assets/Scripts/CultCache/Editor/BaseInspector.cs
Reinier Vens 526a737a4d Modular Database Tools
Extracted all inspector code for database inspector into a single class per supported field type and wrote reflection code to invoke them automatically
Removed all Aetheria-specific code from database tools
Database View editor is now abstract and supports arbitrary grouping of entry types; specific users must implement their own database view
2021-03-31 04:07:11 +01:00

31 lines
No EOL
1 KiB
C#

using System;
public abstract class BaseInspector<T>
{
protected const int width = 150;
protected const int labelWidth = 20;
protected const int toggleWidth = 18;
protected const int arrowWidth = 22;
public abstract T Inspect(string label, T value, object parent, DatabaseInspector inspectorWindow);
}
public abstract class BaseInspector<T, A> where A : Attribute
{
protected const int width = 150;
protected const int labelWidth = 20;
protected const int toggleWidth = 18;
protected const int arrowWidth = 22;
public abstract T Inspect(string label, T value, object parent, DatabaseInspector inspectorWindow, A attribute);
}
public abstract class BaseInspector<T, A, B> where A : Attribute where B : Attribute
{
protected const int width = 150;
protected const int labelWidth = 20;
protected const int toggleWidth = 18;
protected const int arrowWidth = 22;
public abstract T Inspect(string label, T value, object parent, DatabaseInspector inspectorWindow, A attributeA, B attributeB);
}