Skip to main content
Version: Next

Type System Cheat Sheet

Types appear in bean field type, Excel ##type rows, or validator tags. This page gives copy-ready forms; for how to fill cells see Excel basics.

Basic types

TypeDescriptionSample data
boolCase-insensitivetrue / false / 0 / 1 / /
byte / short / int / longIntegers1001
float / doubleFloating point1.5
stringStringhello; empty string fill ""
textSugar for string#text=1Localization key; validity is checked
datetimeExported as UTC seconds (long)2024-01-01 12:00:00

Custom types

TypeDescription
enumEnum; fill item name or alias
beanComposite type; may inherit / be polymorphic

When referencing in schema, write the full type name or the short name in the current module, e.g. Quality, item.Cost, Shape.

Containers

FormDescription
array,TArray
list,TList
set,TSet
map,K,VMap; K is generally a base type or enum

Constraint: element / key / value cannot be nullable (cannot write list,int?, map,int?,string).

Schema example:

<bean name="Bag">
<var name="id" type="int"/>
<var name="item_ids" type="list,int"/>
<var name="tags" type="set,string"/>
<var name="attrs" type="map,int,int"/>
<var name="costs" type="list,Cost"/>
</bean>

With separator, length, and other tags, put container tags on the container, usually with parentheses:

FormMeaning
(list#sep=\|),intSeparate with \| inside the cell
(list#size=4),intLength must be 4
(list#sep=;),Cost#sep=,List uses ;, element Cost uses ,
(map#sep=,),int,stringCompact map

Excel column / multi-row filling: see Nested structures and collections.

Nullable

FormMeaning
int? / string? / Cost?Atomic or non-polymorphic bean nullable
ShapePolymorphic and non-nullable: must give a concrete subclass; cannot be null
Shape?Nullable polymorphism: empty / null allowed

Containers themselves do not support element-nullable forms like list,T?.

Common tags on fields

Written in the type string (Excel ##type or XML type="..."):

FormEffect
int!Cannot be the default (e.g. 0)
int#ref=item.TbItemReference check
int#ref=item.TbItem?0 / empty may skip the reference
int#ref=a.TbA,b.TbBMulti-table reference
string#path=unityAsset path check
int#range=[1,100]Range
int#set=1;2;3Allowed value set
(list#index=id),FooBuild an auxiliary index on list elements by id (e.g. C#)

Full details: Validators.

Special types

TypeDescription
tableManager class for each config table (e.g. TbItem)
TablesEntry class; name comes from targets[].manager

External type mapping (TypeMapper)

You can map bean/enum to existing project types (e.g. UnityEngine.Vector3, UnityEngine.AudioType). Full syntax, matching rules, and examples: External type mapping (TypeMapper).