<data-definition>
    -- MISC TYPES

    <bitfield-type type-name='item_flags'>
        <flag-bit name='on_ground' comment='Item on ground'/>
        <flag-bit name='in_job' comment='Item currently being used in a job'/>
        <flag-bit name='hostile' comment='Item owned by hostile'/>
        <flag-bit name='in_inventory' comment='Item in a creature or workshop inventory'/>

        <flag-bit name='unk1' comment='unknown, lost (artifact)?, unusable, unseen'/>
        <flag-bit name='in_building' comment='Part of a building (including mechanisms, bodies in coffins)'/>
        <flag-bit name='unk2' comment='unknown, unseen'/>
        <flag-bit name='dead_dwarf' comment='Dwarfs dead body or body part'/>

        <flag-bit name='rotten' comment='Rotten food'/>
        <flag-bit name='spider_web' comment='Thread in spider web'/>
        <flag-bit name='construction' comment='Material used in construction'/>
        <flag-bit name='unk3' comment='unknown, unseen, unusable'/>

        <flag-bit name='unk4' comment='unknown, unseen'/>
        <flag-bit name='murder' comment='Implies murder - used in fell moods'/>
        <flag-bit name='foreign' comment='Item is imported'/>
        <flag-bit name='trader' comment='Item ownwed by trader'/>

        <flag-bit name='owned' comment='Item is owned by a dwarf'/>
        <flag-bit name='garbage_colect' comment='Marked for deallocation by DF it seems'/>
        <flag-bit name='artifact1' comment='Artifact ?'/>
        <flag-bit name='forbid' comment='Forbidden item'/>

        <flag-bit name='unk6' comment='unknown, unseen'/>
        <flag-bit name='dump' comment='Designated for dumping'/>
        <flag-bit name='on_fire' comment='Indicates if item is on fire, Will Set Item On Fire if Set!'/>
        <flag-bit name='melt' comment='Designated for melting, if applicable'/>

        <flag-bit name='hidden' comment='Hidden item'/>
        <flag-bit name='in_chest' comment='Stored in chest/part of well?'/>
        <flag-bit name='unk7' comment='unknown, unseen'/>
        <flag-bit name='artifact2' comment='Artifact ?'/>

        <flag-bit name='unk8' comment='unknown, unseen, common'/>
        <flag-bit name='weight_computed'/>
        <flag-bit name='unk10' comment='unknown, unseen'/>
        <flag-bit name='unk11' comment='unknown, unseen'/>
    </bitfield-type>

    <struct-type type-name='contaminant'>
        <int16_t name='mat_type' ref-target='material' aux-value='$$.mat_index'/>
        <int32_t name='mat_index'/>
        <int16_t name='mat_state' comment='enum or document in text'/>
        <uint16_t name='temperature'/>
        <uint16_t name='temperature_fraction'/>
        <int32_t name='size' comment='1-24=spatter, 25-49=smear, 50-* = coating'/>
        <int16_t name='unk' comment='-1'/>
        <int16_t name='id'/>
    </struct-type>

    <enum-type type-name='item_quality'>
        <enum-item name='Ordinary'/>
        <enum-item name='WellCrafted'/>
        <enum-item name='FinelyCrafted'/>
        <enum-item name='Superior'/>
        <enum-item name='Exceptional'/>
        <enum-item name='Masterful'/>
        <enum-item name='Artifact'/>
    </enum-type>

    -- CORE ITEM

    <class-type type-name='item' original-name='itemst'
                instance-vector='$global.world.items.all' key-field='id'>
        <int16_t name='x'/>
        <int16_t name='y'/>
        <int16_t name='z'/>

        <compound name='flags' type-name='item_flags'/>

        <uint32_t name='age'/>
        <uint32_t name='id'/>

        <stl-vector name='jobs'>
            <pointer>
                <int32_t name='unk1'/>
                <pointer name='job' type-name='job'/>
                <int32_t name='unk2'/>
            </pointer>
        </stl-vector>

        <stl-vector name='itemrefs'>
            <pointer type-name='general_ref'/>
        </stl-vector>

        <compound name='temp'>
            <int16_t name='unk1'/>
            <int16_t name='unk2'/>
            <int16_t name='unk3'/>
            <int16_t name='unk4'/>
            <int16_t name='unk5'/>
            <int16_t name='spec_heat'/>
            <int16_t name='ignite_point'/>
            <int16_t name='heatdam_point'/>
            <int16_t name='colddam_point'/>
            <int16_t name='boiling_point'/>
            <int16_t name='melting_point'/>
            <int16_t name='fixed_temp'/>
        </compound>

        <int32_t name='weight' comment='if flags.weight_computed'/>
        <int32_t name='weight_fraction' comment='1e-6'/>

        <virtual-methods>
            <vmethod ret-type='item_type' name='getType'/>
            <vmethod ret-type='int16_t' name='getSubtype'/>
            <vmethod ret-type='int16_t' name='getMaterial'/>
            <vmethod ret-type='int32_t' name='getMaterialIndex'/>
            <vmethod name='setSubtype'> <int16_t/> </vmethod>

            <vmethod name='setMaterial'> <int16_t/> </vmethod>
            <vmethod name='setMaterialIndex'> <int32_t/> </vmethod>
            <vmethod ret-type='int16_t' name='getActualMaterial'
                    comment='returns an actual material type, never a race'/>
            <vmethod ret-type='int32_t' name='getActualMaterialIndex'
                    comment='returns an actual material index, never a caste'/>
            <vmethod ret-type='int16_t' name='getRace'
                    comment='only if the object is made of a "specific creature mat"'/>

            -- 10

            <vmethod ret-type='int16_t' name='getCaste'
                    comment='only if the object is made of a "specific creature mat"'/>
            <vmethod ret-type='int16_t' name='getPlantID'
                    comment='only if the object is made of a plant material'/>
            <vmethod ret-type='int32_t' name='getTotalDimension'/>
            <vmethod name='setDimension'> <int32_t name='amount'/> </vmethod>
            <vmethod ret-type='bool' name='subtractDimension'> <int32_t name='amount'/> </vmethod>

            <vmethod ret-type='bool' name='isFoodStorage'/>
            <vmethod name='getStockpile'>
                <ret-type><pointer type-name='item_stockpile_ref'/></ret-type>
            </vmethod>
            <vmethod ret-type='bool' name='containsPlaster'/>
            <vmethod ret-type='bool' name='isPlaster'/>
            <vmethod ret-type='bool' name='getColorOverride'> <pointer/> </vmethod>

            -- 20

            <vmethod name='getHistoryInfo'>
                <ret-type><pointer><pointer type-name='item_history_info'/></pointer></ret-type>
            </vmethod>
            <vmethod ret-type='bool' name='hasToolUse'> <int16_t/> </vmethod>
            <vmethod name='becomePaste'/>
            <vmethod name='becomePressed'/>
            <vmethod name='calculateWeight'/>

            <vmethod ret-type='bool' name='isSharpStone'/>
            <vmethod ret-type='bool' name='isCrystalGlassable'/>
            <vmethod ret-type='bool' name='isMetalOre'> <int16_t name='matIndex'/> </vmethod>
            <vmethod/>
            <vmethod/>

            -- 30

            <vmethod ret-type='uint16_t' name='getSpecHeat'/>
            <vmethod ret-type='uint16_t' name='getIgnitePoint'/>
            <vmethod ret-type='uint16_t' name='getHeatdamPoint'/>
            <vmethod ret-type='uint16_t' name='getColddamPoint'/>
            <vmethod ret-type='uint16_t' name='getBoilingPoint'/>

            <vmethod ret-type='uint16_t' name='getMeltingPoint'/>
            <vmethod ret-type='uint16_t' name='getFixedTemp'/>
            <vmethod ret-type='int32_t' name='getSolidDensity'/>
            <vmethod ret-type='bool' name='materialRots'/>
            <vmethod ret-type='uint16_t' name='getTemperature'/>

            -- 40

            <vmethod ret-type='bool' name='adjustTemperature'>
                <uint16_t name='target'/>
                <int32_t name='unk'/>
            </vmethod>
            <vmethod/>
            <vmethod name='extinguish'/>
            <vmethod ret-type='int8_t' name='getGloveHandedness'/>
            <vmethod name='setGloveHandedness'> <int8_t/> </vmethod>

            <vmethod ret-type='bool' name='isSpike'/>
            <vmethod ret-type='bool' name='isScrew'/>
            <vmethod ret-type='bool' name='isBuildMat'/>
            <vmethod ret-type='bool' name='isTemperatureSafe'> <int8_t comment='1 fire, 2 magma'/> </vmethod>
            <vmethod name='setRandSubtype'> <pointer/> </vmethod>

            -- 50

            <vmethod/>
            <vmethod ret-type='int16_t' name='getWear'/>
            <vmethod name='setWear'> <int16_t/> </vmethod>
            <vmethod ret-type='int32_t' name='getMaker'/>
            <vmethod name='setMaker'> <int32_t name='unit_id'/> </vmethod>

            <vmethod/>
            <vmethod/>
            <vmethod name='getGloveFlags'>
                <ret-type><pointer><df-flagarray/></pointer></ret-type>
            </vmethod>
            <vmethod name='getItemShapeDesc' comment='a statue/figurine of "string goes here"'>
                <ret-type><pointer type-name='stl-string'/></ret-type>
            </vmethod>
            <vmethod ret-type='bool' name='isMatchingAmmoItem'> <pointer type-name='item_filter_spec'/> </vmethod>

            -- 60

            <vmethod/>
            <vmethod name='setSeedsUnk84'> <int32_t/> </vmethod>
            <vmethod ret-type='int16_t' name='getCorpseUnk17c'/>
            <vmethod name='ageItem'><int32_t name='amount'/></vmethod>
            <vmethod ret-type='int32_t' name='getCritterUnk80'/>

            <vmethod name='setCritterUnk80'> <int32_t/> </vmethod>
            <vmethod name='incrementCritterUnk80'/>
            <vmethod ret-type='int32_t' name='getRotTimer'/>
            <vmethod name='setRotTimer'> <int32_t name='val'/> </vmethod>
            <vmethod name='incrementRotTimer'/>

            -- 70

            <vmethod ret-type='bool' name='isBogeymanCorpse'/>
            <vmethod/>
            <vmethod name='getAmmoType'>
                <ret-type><pointer type-name='stl-string'/></ret-type>
                <pointer type-name='stl-string'/>
            </vmethod>
            <vmethod/>
            <vmethod ret-type='bool' name='isLiquid'/>

            <vmethod/>
            <vmethod/>
            <vmethod/>
            <vmethod ret-type='bool' name='isArmorNotClothing'/>
            <vmethod ret-type='bool' name='isMillable'/>

            -- 80

            <vmethod ret-type='bool' name='isProcessableThread'/>
            <vmethod ret-type='bool' name='isProcessableVial'/>
            <vmethod ret-type='bool' name='isProcessableBag'/>
            <vmethod ret-type='bool' name='isProcessableBarrel'/>
            <vmethod ret-type='bool' name='isEdiblePlant'/>

            <vmethod ret-type='bool' name='isEdibleRaw'> <int32_t name='hunger'/> </vmethod>
            <vmethod/>
            <vmethod/>
            <vmethod/>
            <vmethod/>

            -- 90

            <vmethod/>
            <vmethod ret-type='bool' name='isPressed'/>
            <vmethod/>
            <vmethod/>
            <vmethod/>

            <vmethod/>
            <vmethod/>
            <vmethod/>
            <vmethod/>
            <vmethod/>

            -- 100

            <vmethod/>
            <vmethod/>
            <vmethod ret-type='bool' name='needTwoHandedWield'> <int32_t/> </vmethod>
            <vmethod name='splitStack'>
                <ret-type><pointer type-name='item'/></ret-type>
                <int32_t/>
                <int32_t/>
            </vmethod>
            <vmethod ret-type='bool' name='isTameableVermin'/>

            <vmethod ret-type='bool' name='isDistillable'>
                <bool name='checkKitchenSettings'/>
            </vmethod>
            <vmethod ret-type='bool' name='isDye'/>
            <vmethod/>
            <vmethod ret-type='bool' name='isSandBearing'/>
            <vmethod ret-type='bool' name='isLyeBearing'/>

            -- 110

            <vmethod/>
            <vmethod/>
            <vmethod/>
            <vmethod/>
            <vmethod/>

            <vmethod/>
            <vmethod/>
            <vmethod/>
            <vmethod/>
            <vmethod/>

            -- 120

            <vmethod/>
            <vmethod/>
            <vmethod/>
            <vmethod name='write_file'> <pointer comment='file_compressorst'/> </vmethod>
            <vmethod name='read_file'>
                <pointer comment='file_compressorst'/>
                <int32_t name='loadversion'/>
            </vmethod>

            <vmethod name='getWeaponAttacks'>
                <ret-type><pointer><stl-vector type-name='pointer'/></pointer></ret-type>
            </vmethod>
            <vmethod/>
            <vmethod/>
            <vmethod/>
            <vmethod/>

            -- 130

            <vmethod/>
            <vmethod ret-type='bool' name='isBag' comment='BOX made of cloth'/>
            <vmethod ret-type='bool' name='isSand'/>
            <vmethod ret-type='int32_t' name='getStackSize'/>
            <vmethod name='addStackSize'> <int32_t name='amount'/> </vmethod>

            <vmethod name='setStackSize'> <int32_t name='amount'/> </vmethod>
            <vmethod ret-type='bool' name='isAmmoClass'> <pointer type-name='stl-string'/> </vmethod>
            <vmethod/>
            <vmethod/>
            <vmethod/>

            -- 140

            <vmethod/>
            <vmethod/>
            <vmethod/>
            <vmethod/>
            <vmethod/>

            <vmethod/>
            <vmethod/>
            <vmethod/>
            <vmethod ret-type='int16_t' name='getMeleeSkill'/>
            <vmethod ret-type='int16_t' name='getRangedSkill'/>

            -- 150

            <vmethod name='setQuality'> <int16_t name='quality'/> </vmethod>
            <vmethod ret-type='int16_t' name='getQuality'/>
            <vmethod ret-type='int16_t' name='getOverallQuality'/>
            <vmethod ret-type='int16_t' name='getImprovementQuality'/>
            <vmethod ret-type='int32_t' name='getProjectileSize'/>

            <vmethod/>
            <vmethod name='setSharpness'>
                <int32_t name='unk1'/>
                <int32_t name='unk2'/>
            </vmethod>
            <vmethod ret-type='int32_t' name='getSharpness'/>
            <vmethod ret-type='bool' name='isTotemable'/>
            <vmethod ret-type='bool' name='isDyeable'/>

            -- 160

            <vmethod ret-type='bool' name='isNotDyed'/>
            <vmethod ret-type='bool' name='isDyed'/>
            <vmethod ret-type='bool' name='canSewImage'/>
            <vmethod/>
            <vmethod ret-type='bool' name='isProcessableVialAtStill'/>

            <vmethod/>
            <vmethod ret-type='int32_t' name='getBlockChance'/>
            <vmethod/>
            <vmethod ret-type='int16_t' name='getMakerRace'/>
            <vmethod name='setMakerRace'> <int16_t/> </vmethod>

            -- 170

            <vmethod ret-type='int8_t' name='getEffectiveArmorLevel'
                    comment="adds 1 if it has [METAL_ARMOR_LEVELS] and it's made of an inorganic mat"/>
            <vmethod/>
            <vmethod ret-type='bool' name='isOrganicCloth'/>
            <vmethod/>
            <vmethod/>

            <vmethod/>
            <vmethod ret-type='bool' name='isImproved'/>
            <vmethod ret-type='int32_t' name='getUnk60'/>
            <vmethod name='getItemDescription'>
                <pointer type-name='stl-string'/>
                <int8_t name='mode'/>
            </vmethod>
            <vmethod/>

            -- 180

            <vmethod/>
            <vmethod ret-type='bool' name='isExtractBearingFish'/>
            <vmethod ret-type='bool' name='isExtractBearingVermin'/>
            <vmethod ret-type='int32_t' name='getBaseWeight'/>
            <vmethod ret-type='int32_t' name='getWeightShiftBits'/>

            <vmethod ret-type='bool' name='isCollected'/>
            <vmethod/>
            <vmethod ret-type='bool' name='isEdibleVermin'/>
            <vmethod name='drawSelf'/>
            <vmethod ret-type='bool' name='isRangedWeapon'/>

            -- 190

            <vmethod ret-type='bool' name='isClothing'/>
            <vmethod ret-type='bool' name='isWet'/>
            <vmethod/>
            <vmethod ret-type='bool' name='isAssignedToStockpile'/>
            <vmethod ret-type='bool' name='isAssignedToThisStockpile'> <int32_t/> </vmethod>

            <vmethod/>
            <vmethod name='removeStockpileAssignment'/>
            <vmethod name='getStockpile2'>
                <ret-type><pointer type-name='item_stockpile_ref'/></ret-type>
            </vmethod>
            <vmethod/>
            <vmethod/>

            -- 200

            <vmethod/>
            <vmethod/>
            <vmethod/>
            <vmethod/>
            <vmethod/>

            <vmethod/>
            <vmethod/>
            <vmethod/>
            <vmethod/>
            <vmethod/>

            -- 210

            <vmethod/>
            <vmethod/>
            <vmethod/>
            <vmethod/>
            <vmethod ret-type='int16_t' name='isEngraved' comment='slabs only'/>

            <vmethod ret-type='int32_t' name='getAbsorption'/>
            <vmethod/>
            <vmethod is-destructor='true'/>
        </virtual-methods>
    </class-type>

    -- ACTUAL ITEM

    <struct-type type-name='item_kill_info'>
        <compound name='targets' type-name='historical_kills'/>

        -- Wielders

        <stl-vector name="slayers">
            <int32_t ref-target='historical_figure'/>
        </stl-vector>
        <stl-vector name="slayer_kill_counts" type-name='int32_t'/>
    </struct-type>

    <struct-type type-name='item_history_info'>
        <pointer name='kills' type-name='item_kill_info'/>
        <int32_t name='unk1'/>
        <int32_t name='unk2'/>
    </struct-type>

    <class-type type-name='item_actual' inherits-from='item' original-name='item_actualst'>
        <int32_t name='stack_size'/>

        <code-helper name='describe'>
            (if (> $.stack_size 1) (fmt "stack: ~A" $.stack_size))
            (if (> $.wear 0) (fmt "wear: ~A" $.wear))
        </code-helper>

        <pointer name='history_info'>
            <pointer type-name='item_history_info'/>
        </pointer>

        <pointer name='unk5'>
            <stl-vector/>
        </pointer>

        <pointer name='contaminants'>
            <stl-vector>
                <pointer type-name='contaminant'/>
            </stl-vector>
        </pointer>

        <uint16_t name='temperature'/>
        <uint16_t name='temperature_fraction'/>

        <int16_t name='wear'/>
        <int32_t name='wear_timer' comment='counts up to 806400'/>

        <int32_t name='unk3' comment='-1'/>
    </class-type>

    -- CRAFTED ITEM

    <class-type type-name='item_crafted' inherits-from='item_actual'
                original-name='item_craftedst'>
        <int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
        <int32_t name='matIndex'/>

        <code-helper name='describe'>
            $.quality
            (describe-obj (material-by-id $.matType $.matIndex))
        </code-helper>

        <int16_t name='maker_race' ref-target='creature_raw'/>
        <enum base-type='int16_t' name='quality' type-name='item_quality'/>
        <enum base-type='int32_t' name='skill_used' type-name='job_skill'/>
        <int32_t name='maker' ref-target='historical_figure'/>
        <int32_t name='masterpiece_event' ref-target='history_event'/>
    </class-type>

    -- CONSTRUCTED ITEM

    <class-type type-name='item_constructed' inherits-from='item_crafted'
                original-name='item_constructedst'>
        <stl-vector name='improvements'>
            <pointer/>
        </stl-vector>
    </class-type>

    -- BODY COMPONENT

    <class-type type-name='item_body_component' inherits-from='item_actual'
                original-name='item_body_componentst'>
        <int16_t name='race' ref-target='creature_raw'/>
        <int32_t name='unk_7c'/>
        <int32_t name='unk_80'/>
        <int16_t name='caste' ref-target='caste_raw' aux-value='$$.race'/>
        <int8_t name='unk_86'/>
        <int32_t name='unk_88'/>
        <int8_t name='unk_8c'/>
        <stl-vector name='unk_90'/>
        <padding size='44'/>
        <stl-vector name='unk_cc'/>
        <stl-vector name='unk_dc'/>
        <stl-vector name='unk_ec'/>
        <stl-vector name='unk_fc'/>
        <stl-vector name='unk_10c'/>
        <stl-vector name='unk_11c'/>
        <stl-vector name='unk_12c'/>
        <stl-vector name='unk_13c'/>
        <padding size='72'/>
        <stl-vector name='unk_194'/>
        <stl-vector name='unk_1a4'/>
        <stl-vector name='unk_1b4'/>
        <padding size='20'/>
        <stl-vector name='unk_1d8'/>
        <stl-vector name='unk_1e8'/>
        <stl-vector name='unk_1f8'/>
        <stl-vector name='unk_208'/>
        <stl-vector name='unk_218'/>
        <padding size='12'/>
        <static-array name='unk_234' count='19' type-name='int32_t'/>
        <int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
        <int32_t name='matIndex'/>
        <int16_t name='unk_288'/>
        <int32_t name='unk_28c'/>
    </class-type>

    <class-type type-name='item_corpsest' inherits-from='item_body_component'/>
    <class-type type-name='item_corpsepiecest' inherits-from='item_body_component'/>

    -- CRITTER

    <class-type type-name='item_critter' inherits-from='item_actual' original-name='item_critterst'>
        <int16_t name='race' ref-target='creature_raw'/>
        <int16_t name='caste' ref-target='caste_raw' aux-value='$$.race'/>
        <int32_t name='unk_7c'/>
        <int32_t name='unk_80'/>
    </class-type>

    -- LIQUID/POWER

    <bitfield-type type-name='item_matstate'>
        <flag-bit/>
        <flag-bit name='pressed'/>
        <flag-bit name='paste'/>
    </bitfield-type>

    <class-type type-name='item_liquidpowder' inherits-from='item_actual'
                original-name='item_liquidpowderst'>
        <compound name='mat_state' type-name='item_matstate'/>
        <int32_t name='dimension'/>
        <int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
        <int32_t name='matIndex'/>
    </class-type>

    <class-type type-name='item_liquid' inherits-from='item_liquidpowder' original-name='item_liquidst'/>
    <class-type type-name='item_powder' inherits-from='item_liquidpowder' original-name='item_powderst'/>

    -- MISC

    <class-type type-name='item_barst' inherits-from='item_actual'>
        <int16_t name='subtype'/>
        <int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
        <int32_t name='matIndex'/>
        <int32_t name='dimension'/>
    </class-type>

    <class-type type-name='item_smallgemst' inherits-from='item_actual'>
        <int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
        <int32_t name='matIndex'/>
    </class-type>
    <class-type type-name='item_blocksst' inherits-from='item_actual'>
        <int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
        <int32_t name='matIndex'/>
    </class-type>
    <class-type type-name='item_roughst' inherits-from='item_actual'>
        <int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
        <int32_t name='matIndex'/>
    </class-type>
    <class-type type-name='item_boulderst' inherits-from='item_actual'>
        <int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
        <int32_t name='matIndex'/>
    </class-type>
    <class-type type-name='item_woodst' inherits-from='item_actual'>
        <int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
        <int32_t name='matIndex'/>
    </class-type>

    <class-type type-name='item_rockst' inherits-from='item_actual'>
        <int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
        <int32_t name='matIndex'/>
        <int32_t name='sharpness'/>
        <int32_t name='unk_84'/>
    </class-type>

    <class-type type-name='item_seedsst' inherits-from='item_actual'>
        <int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
        <int32_t name='matIndex'/>
        <int32_t name='unk_80'/>
        <int32_t name='unk_84'/>
    </class-type>

    <class-type type-name='item_skin_tannedst' inherits-from='item_actual'>
        <int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
        <int32_t name='matIndex'/>
        <int32_t name='unk_80'/>
    </class-type>

    <class-type type-name='item_meatst' inherits-from='item_actual'>
        <int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
        <int32_t name='matIndex'/>
        <int32_t name='rot_timer'/>
    </class-type>
    <class-type type-name='item_plantst' inherits-from='item_actual'>
        <int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
        <int32_t name='matIndex'/>
        <int32_t name='rot_timer'/>
    </class-type>
    <class-type type-name='item_leavesst' inherits-from='item_actual'>
        <int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
        <int32_t name='matIndex'/>
        <int32_t name='rot_timer'/>
    </class-type>
    <class-type type-name='item_cheesest' inherits-from='item_actual'>
        <int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
        <int32_t name='matIndex'/>
        <int32_t name='rot_timer'/>
    </class-type>
    <class-type type-name='item_globst' inherits-from='item_actual'>
        <int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
        <int32_t name='matIndex'/>
        <int32_t name='rot_timer'/>
        <compound name='mat_state' type-name='item_matstate'/>
    </class-type>
    <class-type type-name='item_remainsst' inherits-from='item_actual'>
        <int16_t name='race' ref-target='creature_raw'/>
        <int16_t name='caste' ref-target='caste_raw' aux-value='$$.race'/>
        <int32_t name='rot_timer'/>
    </class-type>
    <class-type type-name='item_fishst' inherits-from='item_actual'>
        <int16_t name='race' ref-target='creature_raw'/>
        <int16_t name='caste' ref-target='caste_raw' aux-value='$$.race'/>
        <int32_t name='rot_timer'/>
    </class-type>
    <class-type type-name='item_fish_rawst' inherits-from='item_actual'>
        <int16_t name='race' ref-target='creature_raw'/>
        <int16_t name='caste' ref-target='caste_raw' aux-value='$$.race'/>
        <int32_t name='rot_timer'/>
    </class-type>

    <class-type type-name='item_foodst' inherits-from='item_crafted'>
        <pointer name='subtype' type-name='itemdef_foodst'/>
        <int32_t name='unk_94'/>
        <int16_t name='unk_98'/>
        <stl-vector name='unk_9c'/>
        <int32_t name='rot_timer'/>
    </class-type>

    <class-type type-name='item_verminst' inherits-from='item_critter'/>
    <class-type type-name='item_petst' inherits-from='item_critter'/>

    <class-type type-name='item_drinkst' inherits-from='item_liquid'/>
    <class-type type-name='item_powder_miscst' inherits-from='item_powder'/>
    <class-type type-name='item_liquid_miscst' inherits-from='item_liquid'>
        <int32_t name='unk_88'/>
    </class-type>

    <class-type type-name='item_threadst' inherits-from='item_actual'>
        <int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
        <int32_t name='matIndex'/>
        <int16_t name='dyeColor'/>
        <int32_t name='unk_84'/>
        <int32_t name='unk_88'/>
        <int32_t name='unk_8c'/>
        <int16_t name='unk_90'/>
        <int16_t name='unk_92'/>
        <int32_t name='unk_94'/>
        <int8_t name='unk_98'/>
        <int32_t name='dimension'/>
    </class-type>

    <class-type type-name='item_eggst' inherits-from='item_actual'>
        <int16_t name='race' ref-target='creature_raw'/>
        <int16_t name='caste' ref-target='caste_raw' aux-value='$$.race'/>
        <int32_t name='unk_7c'/>
        <stl-vector name='eggMatType' type-name='int16_t'/>
        <stl-vector name='eggMatIndex' type-name='int32_t'/>
        <padding size='44'/>
        <compound name='unk_cc'>
            <int16_t/>
            <int16_t/>
            <int16_t/>
            <int32_t/>
            <int32_t/>
            <int32_t/>
            <int16_t/>
        </compound>
        <int32_t/>
        <int32_t name='size'/>
    </class-type>

    -- CONSTRUCTED

    <class-type type-name='item_doorst' inherits-from='item_constructed'/>
    <class-type type-name='item_floodgatest' inherits-from='item_constructed'/>
    <class-type type-name='item_bedst' inherits-from='item_constructed'/>
    <class-type type-name='item_chairst' inherits-from='item_constructed'/>
    <class-type type-name='item_chainst' inherits-from='item_constructed'/>
    <class-type type-name='item_flaskst' inherits-from='item_constructed'/>
    <class-type type-name='item_gobletst' inherits-from='item_constructed'/>
    <class-type type-name='item_windowst' inherits-from='item_constructed'/>
    <class-type type-name='item_cagest' inherits-from='item_constructed'/>
    <class-type type-name='item_bucketst' inherits-from='item_constructed'/>
    <class-type type-name='item_animaltrapst' inherits-from='item_constructed'/>
    <class-type type-name='item_tablest' inherits-from='item_constructed'/>
    <class-type type-name='item_coffinst' inherits-from='item_constructed'/>
    <class-type type-name='item_boxst' inherits-from='item_constructed'/>
    <class-type type-name='item_armorstandst' inherits-from='item_constructed'/>
    <class-type type-name='item_weaponrackst' inherits-from='item_constructed'/>
    <class-type type-name='item_cabinetst' inherits-from='item_constructed'/>
    <class-type type-name='item_amuletst' inherits-from='item_constructed'/>
    <class-type type-name='item_scepterst' inherits-from='item_constructed'/>
    <class-type type-name='item_crownst' inherits-from='item_constructed'/>
    <class-type type-name='item_ringst' inherits-from='item_constructed'/>
    <class-type type-name='item_earringst' inherits-from='item_constructed'/>
    <class-type type-name='item_braceletst' inherits-from='item_constructed'/>
    <class-type type-name='item_gemst' inherits-from='item_constructed'/>
    <class-type type-name='item_anvilst' inherits-from='item_constructed'/>
    <class-type type-name='item_backpackst' inherits-from='item_constructed'/>
    <class-type type-name='item_quiverst' inherits-from='item_constructed'/>
    <class-type type-name='item_catapultpartsst' inherits-from='item_constructed'/>
    <class-type type-name='item_ballistapartsst' inherits-from='item_constructed'/>
    <class-type type-name='item_trappartsst' inherits-from='item_constructed'/>
    <class-type type-name='item_pipe_sectionst' inherits-from='item_constructed'/>
    <class-type type-name='item_hatch_coverst' inherits-from='item_constructed'/>
    <class-type type-name='item_gratest' inherits-from='item_constructed'/>
    <class-type type-name='item_quernst' inherits-from='item_constructed'/>
    <class-type type-name='item_millstonest' inherits-from='item_constructed'/>
    <class-type type-name='item_splintst' inherits-from='item_constructed'/>
    <class-type type-name='item_crutchst' inherits-from='item_constructed'/>
    <class-type type-name='item_traction_benchst' inherits-from='item_constructed'/>

    <class-type type-name='item_instrumentst' inherits-from='item_constructed'>
        <pointer name='subtype' type-name='itemdef_instrumentst'/>
    </class-type>
    <class-type type-name='item_toyst' inherits-from='item_constructed'>
        <pointer name='subtype' type-name='itemdef_toyst'/>
    </class-type>
    <class-type type-name='item_armorst' inherits-from='item_constructed'>
        <pointer name='subtype' type-name='itemdef_armorst'/>
    </class-type>
    <class-type type-name='item_shoesst' inherits-from='item_constructed'>
        <pointer name='subtype' type-name='itemdef_shoesst'/>
    </class-type>
    <class-type type-name='item_shieldst' inherits-from='item_constructed'>
        <pointer name='subtype' type-name='itemdef_shieldst'/>
    </class-type>
    <class-type type-name='item_helmst' inherits-from='item_constructed'>
        <pointer name='subtype' type-name='itemdef_helmst'/>
    </class-type>
    <class-type type-name='item_glovesst' inherits-from='item_constructed'>
        <pointer name='subtype' type-name='itemdef_glovesst'/>
        <df-flagarray name='flags' comment='1 right, 2 left'/>
    </class-type>
    <class-type type-name='item_pantsst' inherits-from='item_constructed'>
        <pointer name='subtype' type-name='itemdef_pantsst'/>
    </class-type>
    <class-type type-name='item_siegeammost' inherits-from='item_constructed'>
        <pointer name='subtype' type-name='itemdef_siegeammost'/>
    </class-type>
    <class-type type-name='item_weaponst' inherits-from='item_constructed'>
        <pointer name='subtype' type-name='itemdef_weaponst'/>
        <int32_t name='sharpness'/>
    </class-type>
    <class-type type-name='item_ammost' inherits-from='item_constructed'>
        <pointer name='subtype' type-name='itemdef_ammost'/>
        <int32_t name='sharpness'/>
    </class-type>
    <class-type type-name='item_trapcompst' inherits-from='item_constructed'>
        <pointer name='subtype' type-name='itemdef_trapcompst'/>
        <int32_t name='sharpness'/>
    </class-type>
    <class-type type-name='item_toolst' inherits-from='item_constructed'>
        <pointer name='subtype' type-name='itemdef_toolst'/>
        <int32_t name='sharpness'/>
        <compound name='stockpile' type-name='item_stockpile_ref'/>
    </class-type>

    <struct-type type-name='item_stockpile_ref'>
        <int32_t name='id' ref-target='building'/>
        <int16_t name='x'/>
        <int16_t name='y'/>
    </struct-type>

    <class-type type-name='item_barrelst' inherits-from='item_constructed'>
        <compound name='stockpile' type-name='item_stockpile_ref'/>
    </class-type>
    <class-type type-name='item_binst' inherits-from='item_constructed'>
        <compound name='stockpile' type-name='item_stockpile_ref'/>
    </class-type>

    <class-type type-name='item_statuest' inherits-from='item_constructed'>
        <int32_t name='unk_a0'/>
        <int16_t name='unk_a4'/>
        <stl-string name='description'/>
    </class-type>
    <class-type type-name='item_figurinest' inherits-from='item_constructed'>
        <int32_t name='unk_a0'/>
        <int16_t name='unk_a4'/>
        <stl-string name='description'/>
    </class-type>

    <class-type type-name='item_slabst' inherits-from='item_constructed'>
        <stl-string name='description'/>
        <int32_t name='unk_bc'/>
        <int16_t name='unk_c0'/>
    </class-type>

    <class-type type-name='item_orthopedic_castst' inherits-from='item_constructed'>
        <stl-string name='unk_a0'/>
        <stl-string name='unk_bc'/>
    </class-type>

    <class-type type-name='item_coinst' inherits-from='item_constructed'>
        <int16_t name='unk_a0'/>
    </class-type>

    <class-type type-name='item_totemst' inherits-from='item_constructed'>
        <int16_t name='unk_a0'/>
        <int16_t name='unk_a2'/>
        <int16_t name='unk_a4'/>
    </class-type>

    <class-type type-name='item_clothst' inherits-from='item_constructed'>
        <int32_t name='dimension'/>
    </class-type>

    <class-type type-name='item_ballistaarrowheadst' inherits-from='item_actual'>
        <int16_t name='matType' ref-target='material' aux-value='$$.matIndex'/>
        <int32_t name='matIndex'/>
    </class-type>
</data-definition>

<!--
Local Variables:
indent-tabs-mode: nil
nxml-child-indent: 4
End:
-->