include "Math/PackedVec3f.fbs";

namespace pkNX.Structures.FlatBuffers.SV.Trinity;
attribute "fs_serializer";

table SubScene (fs_serializer) {
    Field_00:string (required);
    Field_01:string (required);
}

table TIFieldComponent (fs_serializer) {
    Field_00:uint;
    Field_01:uint;
    Field_02:uint;
    Field_03:uint;
    Field_04:uint;
}

table TIPokemonModelComponent (fs_serializer) {
    DevId:ushort;
    FormId:ushort;
    Sex:byte;
    IsRare:bool;
    IsEgg:bool;
    Scale:ubyte;
    Field_07:byte; // always 0
    Field_08:byte; // always 0
    Visible:bool;
}

table TIFieldPokemonComponent (fs_serializer) {
    DevId:ushort;
    FormId:ushort;
    Sex:byte;
    Field_03:byte; // always 0
    Field_04:byte; // unknown
}

table TIFieldAttributePickerComponent (fs_serializer) {
    Field_00:float;
    Field_01:bool;
    Field_02:float;
    Field_03:float;
}

table PEAudioGeneratorComponent (fs_serializer) {
    Field_00:string (required);
    Field_01:string (required);
    Field_02:byte; // unknown
    Field_03:byte; // unknown
    Field_04:byte; // unknown
    Field_05:byte; // unknown
    Field_06:float;
    Field_07:uint;
    Field_08:byte; // unknown -- probably an object[]? of some sort
    Field_09:[float]; // not required
    Field_10:byte; // unknown
    Field_11:byte; // unknown
    Field_12:string (required);
}

table TrinityCollisionEventTriggerComponent (fs_serializer) {
    Field_00:string (required);
    Field_01:string (required);
    Field_02:byte; // unknown
    Field_03:uint; // unknown
    Field_04:string (required);
    Field_05:string (required);
}

table PEFlatbuffersDataComponentInner (fs_serializer) {
    Field_00:string (required);
    Field_01:string (required);
}

table PEFlatbuffersDataComponent (fs_serializer) {
    Field_00:string (required);
    Field_01:[PEFlatbuffersDataComponentInner];
}

table TrinityObjectSwitcher (fs_serializer) {
    Field_00:string (required);
    Field_01:string (required);
}

table TrinityScriptComponent (fs_serializer) {
    ScriptFileName:string (required);
    ScriptFileNameHash:string (required);
    Field_02:uint;
    Field_03:uint;
    Field_04:uint;
    ScriptFileClass:string (required);
}

table TrinitySceneObjectPosition {
    Field_00:PackedVec3f (required);
    Field_01:PackedVec3f (required);
    Field_02:PackedVec3f (required);
}

table TrinitySceneObject (fs_serializer) {
    ObjectName:string (required);
    ObjectPosition:TrinitySceneObjectPosition (required);
    Field_02:uint;
    Field_03:uint;
    Field_04:string (required);
    Field_05:ubyte;
    Field_06:uint;
    Field_07:string (required);
    Field_08:[string] (required);
}

table TrinityCharacterCreationMasterComponent (fs_serializer) {
    Field_00:string (required);
    Field_01:byte;
    Field_02:float;
    Field_03:float;
    Field_04:float;
    Field_05:byte;
    Field_06:float;
    Field_07:uint;
    Field_08:float;
    Field_09:uint;
    Field_10:float;
    Field_11:uint;
    Field_12:float;
    Field_13:byte;
    Field_14:uint;
    Field_15:[TrinityCharacterCreationMasterComponentInner] (required);
    Field_16:string;
}

table TrinityCharacterCreationMasterComponentInner (fs_serializer) {
    ModelType:string;
    ModelPath:string;
    Variant:string;
}

root_type TrinitySceneObject;
