buildings

buildings.building_type

<enum-type type-name="building_type">
  <enum-attr name="classname"/>
  <enum-item name="NONE" value="-1"/>
  <enum-item name="Chair">
    <item-attr name="classname" value="building_chairst"/>
  </enum-item>
  <enum-item name="Bed">
    <item-attr name="classname" value="building_bedst"/>
  </enum-item>
  <enum-item name="Table">
    <item-attr name="classname" value="building_tablest"/>
  </enum-item>
  <enum-item name="Coffin">
    <item-attr name="classname" value="building_coffinst"/>
  </enum-item>
  <enum-item name="FarmPlot">
    <item-attr name="classname" value="building_farmplotst"/>
  </enum-item>
  <enum-item name="Furnace">
    <item-attr name="classname" value="building_furnacest"/>
  </enum-item>
  <enum-item name="TradeDepot">
    <item-attr name="classname" value="building_tradedepotst"/>
  </enum-item>
  <enum-item name="Shop">
    <item-attr name="classname" value="building_shopst"/>
  </enum-item>
  <enum-item name="Door">
    <item-attr name="classname" value="building_doorst"/>
  </enum-item>
  <enum-item name="Floodgate">
    <item-attr name="classname" value="building_floodgatest"/>
  </enum-item>
  <enum-item name="Box">
    <item-attr name="classname" value="building_boxst"/>
  </enum-item>
  <enum-item name="Weaponrack">
    <item-attr name="classname" value="building_weaponrackst"/>
  </enum-item>
  <enum-item name="Armorstand">
    <item-attr name="classname" value="building_armorstandst"/>
  </enum-item>
  <enum-item name="Workshop">
    <item-attr name="classname" value="building_workshopst"/>
  </enum-item>
  <enum-item name="Cabinet">
    <item-attr name="classname" value="building_cabinetst"/>
  </enum-item>
  <enum-item name="Statue">
    <item-attr name="classname" value="building_statuest"/>
  </enum-item>
  <enum-item name="WindowGlass">
    <item-attr name="classname" value="building_window_glassst"/>
  </enum-item>
  <enum-item name="WindowGem">
    <item-attr name="classname" value="building_window_gemst"/>
  </enum-item>
  <enum-item name="Well">
    <item-attr name="classname" value="building_wellst"/>
  </enum-item>
  <enum-item name="Bridge">
    <item-attr name="classname" value="building_bridgest"/>
  </enum-item>
  <enum-item name="RoadDirt">
    <item-attr name="classname" value="building_road_dirtst"/>
  </enum-item>
  <enum-item name="RoadPaved">
    <item-attr name="classname" value="building_road_pavedst"/>
  </enum-item>
  <enum-item name="SiegeEngine">
    <item-attr name="classname" value="building_siegeenginest"/>
  </enum-item>
  <enum-item name="Trap">
    <item-attr name="classname" value="building_trapst"/>
  </enum-item>
  <enum-item name="AnimalTrap">
    <item-attr name="classname" value="building_animaltrapst"/>
  </enum-item>
  <enum-item name="Support">
    <item-attr name="classname" value="building_supportst"/>
  </enum-item>
  <enum-item name="ArcheryTarget">
    <item-attr name="classname" value="building_archerytargetst"/>
  </enum-item>
  <enum-item name="Chain">
    <item-attr name="classname" value="building_chainst"/>
  </enum-item>
  <enum-item name="Cage">
    <item-attr name="classname" value="building_cagest"/>
  </enum-item>
  <enum-item name="Stockpile">
    <item-attr name="classname" value="building_stockpilest"/>
  </enum-item>
  <enum-item name="Civzone">
    <item-attr name="classname" value="building_civzonest"/>
  </enum-item>
  <enum-item name="Weapon">
    <item-attr name="classname" value="building_weaponst"/>
  </enum-item>
  <enum-item name="Wagon">
    <item-attr name="classname" value="building_wagonst"/>
  </enum-item>
  <enum-item name="ScrewPump">
    <item-attr name="classname" value="building_screw_pumpst"/>
  </enum-item>
  <enum-item name="Construction">
    <item-attr name="classname" value="building_constructionst"/>
  </enum-item>
  <enum-item name="Hatch">
    <item-attr name="classname" value="building_hatchst"/>
  </enum-item>
  <enum-item name="GrateWall">
    <item-attr name="classname" value="building_grate_wallst"/>
  </enum-item>
  <enum-item name="GrateFloor">
    <item-attr name="classname" value="building_grate_floorst"/>
  </enum-item>
  <enum-item name="BarsVertical">
    <item-attr name="classname" value="building_bars_verticalst"/>
  </enum-item>
  <enum-item name="BarsFloor">
    <item-attr name="classname" value="building_bars_floorst"/>
  </enum-item>
  <enum-item name="GearAssembly">
    <item-attr name="classname" value="building_gear_assemblyst"/>
  </enum-item>
  <enum-item name="AxleHorizontal">
    <item-attr name="classname" value="building_axle_horizontalst"/>
  </enum-item>
  <enum-item name="AxleVertical">
    <item-attr name="classname" value="building_axle_verticalst"/>
  </enum-item>
  <enum-item name="WaterWheel">
    <item-attr name="classname" value="building_water_wheelst"/>
  </enum-item>
  <enum-item name="Windmill">
    <item-attr name="classname" value="building_windmillst"/>
  </enum-item>
  <enum-item name="TractionBench">
    <item-attr name="classname" value="building_traction_benchst"/>
  </enum-item>
  <enum-item name="Slab">
    <item-attr name="classname" value="building_slabst"/>
  </enum-item>
  <enum-item name="Nest">
    <item-attr name="classname" value="building_nestst"/>
  </enum-item>
  <enum-item name="NestBox">
    <item-attr name="classname" value="building_nest_boxst"/>
  </enum-item>
  <enum-item name="Hive">
    <item-attr name="classname" value="building_hivest"/>
  </enum-item>
  <enum-item name="Rollers">
    <item-attr name="classname" value="building_rollersst"/>
  </enum-item>
  <enum-item name="Instrument">
    <item-attr name="classname" value="building_instrumentst"/>
  </enum-item>
  <enum-item name="Bookcase">
    <item-attr name="classname" value="building_bookcasest"/>
  </enum-item>
</enum-type>

buildings.building_flags

<bitfield-type type-name="building_flags">
  <flag-bit name="exists">
    actually built, not just ordered
  </flag-bit>
  <flag-bit name="site_blocked">
    items on ground on site
  </flag-bit>
  <flag-bit name="room_collision">
    major intersection with another room?
  </flag-bit>
  <flag-bit/>
  <flag-bit name="justice"/>
  <flag-bit name="almost_deleted">
    when requesting delete while in_update
  </flag-bit>
  <flag-bit name="in_update"/>
  <flag-bit name="from_worldgen"/>
</bitfield-type>

buildings.door_flags

<bitfield-type type-name="door_flags" base-type="uint16_t">
  <flag-bit name="forbidden"/>
  <flag-bit name="internal"/>
  <flag-bit name="taken_by_invaders"/>
  <flag-bit name="used_by_intruder"/>
  <flag-bit name="closed"/>
  <flag-bit name="operated_by_mechanisms"/>
  <flag-bit name="pet_passable"/>
</bitfield-type>

buildings.gate_flags

<bitfield-type type-name="gate_flags" base-type="uint16_t">
  <flag-bit name="closed"/>
  <flag-bit name="closing"/>
  <flag-bit name="opening"/>
  <flag-bit name="collapsing">
    ?; bridge
  </flag-bit>
  <flag-bit name="has_support">
    bridge
  </flag-bit>
</bitfield-type>

buildings.building_extents

<struct-type type-name="building_extents">
  <pointer name="extents" type-name="uint8_t" is-array="true">
    0 - not room; 1 in stockpile; 2 wall; 3 inner; 4 distance
    boundary.
  </pointer>
  <int32_t name="x"/>
  <int32_t name="y"/>
  <int32_t name="width"/>
  <int32_t name="height"/>
</struct-type>

buildings.building_drawbuffer

<struct-type type-name="building_drawbuffer">
  <static-array name="tile" count="31">
    <static-array count="31" type-name="uint8_t"/>
  </static-array>
  <static-array name="fore" count="31">
    <static-array count="31" type-name="int8_t"/>
  </static-array>
  <static-array name="back" count="31">
    <static-array count="31" type-name="int8_t"/>
  </static-array>
  <static-array name="bright" count="31">
    <static-array count="31" type-name="int8_t"/>
  </static-array>
  <int16_t name="x1"/>
  <int16_t name="x2"/>
  <int16_t name="y1"/>
  <int16_t name="y2"/>
</struct-type>

buildings.building

<class-type type-name="building" original-name="buildingst"
    instance-vector="$global.world.buildings.all" key-field="id">
  <int32_t name="x1">
    top left
  </int32_t>
  <int32_t name="y1"/>
  <int32_t name="centerx">
    work location
  </int32_t>
  <int32_t name="x2">
    bottom right
  </int32_t>
  <int32_t name="y2"/>
  <int32_t name="centery"/>
  <int32_t name="z"/>
  <compound name="flags" type-name="building_flags"/>
  <int16_t name="mat_type" ref-target="material"
      aux-value="$$.mat_index"/>
  <int32_t name="mat_index" init-value="-1"/>
  <compound name="room" type-name="building_extents"/>
  <int32_t name="age"/>
  <int16_t name="race" ref-target="creature_raw"/>
  <int32_t name="id" init-value="-1"/>
  <stl-vector name="jobs" pointer-type="job"/>
  <stl-vector name="specific_refs" pointer-type="specific_ref"/>
  <stl-vector name="general_refs" pointer-type="general_ref"/>
  <bool name="is_room"/>
  <stl-vector name="children" pointer-type="building">
    other buildings within this room
  </stl-vector>
  <stl-vector name="parents" pointer-type="building">
    rooms this building belongs to
  </stl-vector>
  <int32_t name="owner_id" ref-target="unit">
    v0.40.1
  </int32_t>
  <pointer type-name="unit" name="owner"/>
  <stl-vector name="job_claim_suppress">
    <pointer>
      <pointer name="unit" type-name="unit"/>
      <int32_t name="timer"/>
    </pointer>
    after Remv Cre, prevents unit from taking jobs at building
  </stl-vector>
  <stl-string name="name"/>
  <stl-vector name="activities">
    <pointer>
      <int32_t name="activity_id" ref-target="activity_entry"/>
      <int32_t name="event_id" ref-target="activity_event"
          aux-value="$$.activity_id"/>
    </pointer>
  </stl-vector>
  <int32_t name="world_data_id" ref-target="world_object_data">
    v0.34.01
  </int32_t>
  <int32_t name="world_data_subid" init-value="-1">
    v0.34.01
  </int32_t>
  <int32_t name="unk_v40_2" init-value="-1">
    v0.40.1
  </int32_t>
  <int32_t name="site_id" ref-target="world_site">
    v0.42.1
  </int32_t>
  <int32_t name="location_id" ref-target="abstract_building"
      aux-value="$$.site_id">
    v0.42.1
  </int32_t>
  <int32_t name="unk_v40_3" init-value="-1">
    v0.40.1
  </int32_t>
  <virtual-methods>
    <vmethod ret-type="int32_t" name="getCustomType"/>
    <vmethod name="setCustomType">
      <int32_t name="type"/>
    </vmethod>
    <vmethod name="countHospitalSupplies">
      <pointer name="supplies" type-name="hospital_supplies"/>
    </vmethod>
    <vmethod name="countTavernSupplies">
      <pointer name="supplies"/>
    </vmethod>
    <vmethod name="getStockpileLinks">
      <ret-type>
        <pointer type-name="stockpile_links"/>
      </ret-type>
    </vmethod>
    <vmethod name="detachWorldData">
      ?
    </vmethod>
    <vmethod ret-type="bool" name="canLinkToStockpile">
      used by the give to building ui of stockpile
    </vmethod>
    <vmethod name="getUsers">
      <ret-type>
        <pointer type-name="building_users"/>
      </ret-type>
    </vmethod>
    <vmethod name="moveBuilding">
      <int16_t name="delta_x"/>
      <int16_t name="delta_y"/>
      <int16_t name="delta_z"/>
    </vmethod>
    <vmethod name="initOccupancy">
      <int32_t name="abs_x"/>
      <int32_t name="abs_y"/>
    </vmethod>
    <vmethod name="setFillTimer">
      <enum base-type="int32_t" type-name="job_type"/>
      <int16_t/>
    </vmethod>
    <vmethod ret-type="bool" name="isOnFire"/>
    <vmethod ret-type="bool" name="isUnpowered">
      from magma OR machine power
    </vmethod>
    <vmethod ret-type="bool" name="canCollapse"/>
    <vmethod ret-type="uint32_t" name="getPassableOccupancy"/>
    <vmethod ret-type="uint32_t" name="getImpassableOccupancy"/>
    <vmethod ret-type="bool" name="isPowerSource"/>
    <vmethod name="updateFromWeather"/>
    <vmethod name="updateTemperature"/>
    <vmethod name="updateItems"/>
    <vmethod name="updateTempFromTile">
      <uint16_t name="temp"/>
      <bool/>
      <bool/>
    </vmethod>
    <vmethod ret-type="bool" name="isNormalFurniture"/>
    <vmethod ret-type="bool" name="isFarmPlot"/>
    <vmethod name="getWorkshopProfile">
      <ret-type>
        <pointer type-name="workshop_profile"/>
      </ret-type>
    </vmethod>
    <vmethod name="getMachineInfo">
      <ret-type>
        <pointer type-name="machine_info"/>
      </ret-type>
    </vmethod>
    <vmethod name="getPowerInfo">
      <pointer name="power_info" type-name="power_info"/>
    </vmethod>
    <vmethod ret-type="bool" name="canConnectToMachine">
      <pointer type-name="machine_tile_set"/>
    </vmethod>
    <vmethod ret-type="building_type" name="getType"/>
    <vmethod ret-type="int16_t" name="getSubtype"/>
    <vmethod name="setSubtype">
      <int16_t name="subtype"/>
    </vmethod>
    <vmethod ret-type="bool" name="isActual"/>
    <vmethod ret-type="bool" name="isCoffin2"/>
    <vmethod name="updateAction"/>
    <vmethod ret-type="bool" name="isStatueOrRestraint"/>
    <vmethod name="setMaterialAmount">
      <int32_t/>
    </vmethod>
    <vmethod name="setBuildStage">
      <int16_t name="stage"/>
    </vmethod>
    <vmethod ret-type="int32_t" name="getBuildStage"/>
    <vmethod ret-type="int32_t" name="getMaxBuildStage"/>
    <vmethod ret-type="int32_t" name="getArchitectureValue">
      bridge: material*10 rough, material*30 smooth
    </vmethod>
    <vmethod ret-type="bool" name="isSettingOccupancy"/>
    <vmethod ret-type="bool" name="isActual2"/>
    <vmethod ret-type="bool" name="isExtentShaped"/>
    <vmethod name="updateOccupancy">
      <int32_t name="abs_x"/>
      <int32_t name="abs_y"/>
    </vmethod>
    <vmethod ret-type="int32_t" name="getRoomValue">
      <pointer type-name="unit"/>
    </vmethod>
    <vmethod ret-type="int32_t" name="getPersonalValue">
      <pointer type-name="unit"/>
    </vmethod>
    <vmethod ret-type="bool" name="canBeRoom"/>
    <vmethod ret-type="int32_t" name="getConstructionValue">
      bridge: material*10
    </vmethod>
    <vmethod name="queueDestroy">
      same as querying and pressing X
    </vmethod>
    <vmethod ret-type="bool" name="isImpassableTile">
      <int32_t name="rel_x"/>
      <int32_t name="rel_y"/>
    </vmethod>
    <vmethod ret-type="int32_t" name="getFreeCapacity">
      <bool name="subtract_pending_jobs"/>
    </vmethod>
    <vmethod ret-type="bool" name="canStoreItem">
      <pointer type-name="item"/>
      <bool name="subtract_pending_jobs"/>
    </vmethod>
    <vmethod name="getName">
      <pointer type-name="stl-string" name="name"/>
    </vmethod>
    <vmethod name="getNameColor"/>
    <vmethod name="initFarmSeasons"/>
    <vmethod name="initBurialFlags"/>
    <vmethod name="clearBurialFlags"/>
    <vmethod name="clearBurialFlags2"/>
    <vmethod ret-type="int32_t" name="getClutterLevel">
      1..10
    </vmethod>
    <vmethod ret-type="bool" name="needsDesign"/>
    <vmethod ret-type="bool" name="canUseForMood">
      <enum base-type="int16_t" type-name="job_type"/>
    </vmethod>
    <vmethod ret-type="bool" name="canBeRoomSubset"/>
    <vmethod ret-type="bool" name="isCoffin"/>
    <vmethod ret-type="bool" name="canUseSpouseRoom"/>
    <vmethod ret-type="bool" name="canMakeRoom">
      false if already, or cannot be
    </vmethod>
    <vmethod ret-type="bool" name="isJusticeRestraint"/>
    <vmethod name="detachRestrainedUnit">
      <pointer type-name="unit"/>
    </vmethod>
    <vmethod name="write_file">
      <pointer name="file" type-name="file_compressorst"/>
    </vmethod>
    <vmethod name="read_file">
      <pointer name="file" type-name="file_compressorst"/>
      <int32_t name="loadversion"/>
    </vmethod>
    <vmethod ret-type="bool" name="isImpassableAtCreation">
      the true set looks like things where the unit should stand aside
    </vmethod>
    <vmethod name="categorize">
      <bool name="in_play"/>
      Add to world.buildings.other.*
    </vmethod>
    <vmethod name="uncategorize">
      Remove from world.buildings.other.*
    </vmethod>
    <vmethod ret-type="int32_t" name="getBaseValue"/>
    <vmethod name="setTriggerState">
      <int32_t name="new_state">
        0 = active/open, 1 = inactive/closed
      </int32_t>
    </vmethod>
    <vmethod name="checkAdvmodeLocked"/>
    <vmethod name="drawAdvmodeUnlockUI"/>
    <vmethod name="advmodeUnlock">
      <pointer/>
    </vmethod>
    <vmethod ret-type="bool" name="needsMagma"/>
    <vmethod name="removeUses">
      <bool name="noscatter"/>
      <bool name="lost"/>
    </vmethod>
    <vmethod name="deconstructItems">
      <bool name="noscatter"/>
      <bool name="lost"/>
    </vmethod>
    <vmethod name="cleanupMap"/>
    <vmethod ret-type="bool" name="isFireSafe">
      <int8_t name="fire_type"/>
      checks contained_items[0] for FIREIMMUNE
    </vmethod>
    <vmethod name="fillSidebarMenu"/>
    <vmethod ret-type="bool" name="isForbidden"/>
    <vmethod/>
    <vmethod ret-type="bool" name="isHidden"/>
    <vmethod ret-type="bool" name="isVisibleInUI">
      not hidden, or hide/unhide UI mode
    </vmethod>
    <vmethod ret-type="bool" name="isVisibleInViewport">
      <pointer name="viewport" type-name="map_viewport"/>
      checks coordinates, calls isVisibleInUI and checks window_xy
    </vmethod>
    <vmethod name="getDrawExtents">
      <pointer name="buffer" type-name="building_drawbuffer"/>
    </vmethod>
    <vmethod name="drawBuilding">
      <pointer name="buffer" type-name="building_drawbuffer"/>
      <int16_t name="z_offset">
        building_wellst only
      </int16_t>
    </vmethod>
    <vmethod name="setSquadUse">
      <int32_t name="squad"/>
      <uint32_t>
        squad_use_flags.whole
      </uint32_t>
    </vmethod>
    <vmethod name="getSquads">
      <ret-type>
        <pointer>
          <stl-vector pointer-type="building_squad_use"/>
        </pointer>
      </ret-type>
    </vmethod>
    <vmethod name="getSpecificSquad" ret-type="int32_t"/>
    <vmethod name="getSpecificPosition" ret-type="int32_t"/>
    <vmethod name="setSpecificSquadPos">
      <int32_t/>
      <int32_t/>
    </vmethod>
    <vmethod name="clearSpecificSquad"/>
    <vmethod>
      v0.42.01, related to tavern beds
    </vmethod>
    <vmethod is-destructor="true"/>
  </virtual-methods>
</class-type>

buildings.building_stockpilest

<class-type type-name="building_stockpilest" inherits-from="building">
  <compound type-name="stockpile_settings" name="settings"/>
  <int16_t name="max_barrels"/>
  <int16_t name="max_bins"/>
  <int16_t name="max_wheelbarrows"/>
  <stl-vector name="container_type">
    <enum base-type="int16_t" type-name="item_type"/>
  </stl-vector>
  <stl-vector name="container_item_id" type-name="int32_t"
      ref-target="item"/>
  <stl-vector name="container_x" type-name="int16_t"/>
  <stl-vector name="container_y" type-name="int16_t"/>
  <compound name="links" type-name="stockpile_links"/>
  <int32_t name="use_links_only"/>
  <int32_t name="stockpile_number" init-value="-1"/>
  <stl-vector name="linked_stops" pointer-type="hauling_stop"/>
</class-type>

buildings.hospital_supplies

<struct-type type-name="hospital_supplies">
  <bitfield name="supplies_needed" base-type="uint32_t">
    <flag-bit name="splints"/>
    <flag-bit name="thread"/>
    <flag-bit name="cloth"/>
    <flag-bit name="crutches"/>
    <flag-bit name="plaster"/>
    <flag-bit name="buckets"/>
    <flag-bit name="soap"/>
  </bitfield>
  <int32_t name="max_splints" init-value="5"/>
  <int32_t name="max_thread" init-value="75000"/>
  <int32_t name="max_cloth" init-value="50000"/>
  <int32_t name="max_crutches" init-value="5"/>
  <int32_t name="max_plaster" init-value="750"/>
  <int32_t name="max_buckets" init-value="2"/>
  <int32_t name="max_soap" init-value="750"/>
  <int32_t name="cur_splints"/>
  <int32_t name="cur_thread"/>
  <int32_t name="cur_cloth"/>
  <int32_t name="cur_crutches"/>
  <int32_t name="cur_plaster"/>
  <int32_t name="cur_buckets"/>
  <int32_t name="cur_soap"/>
  <int32_t name="supply_recheck_timer"/>
</struct-type>

buildings.civzone_type

<enum-type type-name="civzone_type" base-type="int16_t">
  <enum-item name="Home"/>
  <enum-item name="Depot"/>
  <enum-item name="Stockpile"/>
  <enum-item name="NobleQuarters"/>
  <enum-item/>
  <enum-item/>
  <enum-item/>
  <enum-item name="MeadHall"/>
  <enum-item name="ThroneRoom"/>
  <enum-item name="ActivityZone"/>
  <enum-item name="Temple"/>
  <enum-item name="Kitchen"/>
  <enum-item name="CaptiveRoom"/>
  <enum-item name="TowerTop"/>
  <enum-item name="Courtyard"/>
  <enum-item name="Treasury"/>
  <enum-item name="GuardPost"/>
  <enum-item name="Entrance"/>
  <enum-item name="SecretLibrary"/>
  <enum-item name="Library"/>
  <enum-item name="Plot"/>
  <enum-item name="MarketStall"/>
  <enum-item/>
  <enum-item name="Campground"/>
  <enum-item name="CommandTent"/>
  <enum-item name="Tent"/>
  <enum-item name="CommandTentBld"/>
  <enum-item name="TentBld"/>
  <enum-item name="MechanismRoom"/>
  <enum-item name="DungeonCell"/>
  <enum-item name="AnimalPit"/>
  <enum-item name="ClothPit"/>
  <enum-item name="TanningPit"/>
  <enum-item name="ClothClothingPit"/>
  <enum-item name="LeatherClothingPit"/>
  <enum-item name="BoneCarvingPit"/>
  <enum-item name="GemCuttingPit"/>
  <enum-item name="WeaponsmithingPit"/>
  <enum-item name="BowmakingPit"/>
  <enum-item name="BlacksmithingPit"/>
  <enum-item name="ArmorsmithingPit"/>
  <enum-item name="MetalCraftingPit"/>
  <enum-item name="LeatherworkingPit"/>
  <enum-item name="CarpentryPit"/>
  <enum-item name="StoneworkingPit"/>
  <enum-item name="ForgingPit"/>
  <enum-item name="FightingPit"/>
  <enum-item/>
  <enum-item/>
  <enum-item/>
  <enum-item/>
  <enum-item/>
  <enum-item/>
  <enum-item name="AnimalWorkshop"/>
  <enum-item name="ClothWorkshop"/>
  <enum-item name="TanningWorkshop"/>
  <enum-item name="ClothClothingWorkshop"/>
  <enum-item name="LeatherClothingWorkshop"/>
  <enum-item name="BoneCarvingWorkshop"/>
  <enum-item name="GemCuttingWorkshop"/>
  <enum-item name="WeaponsmithingWorkshop"/>
  <enum-item name="BowmakingWorkshop"/>
  <enum-item name="BlacksmithingWorkshop"/>
  <enum-item name="ArmorsmithingWorkshop"/>
  <enum-item name="MetalCraftingWorkshop"/>
  <enum-item name="LeatherworkingShop"/>
  <enum-item name="CarpentryWorkshop"/>
  <enum-item name="StoneworkingWorkshop"/>
  <enum-item name="ForgingWorkshop"/>
</enum-type>

buildings.building_civzonest

<class-type type-name="building_civzonest" inherits-from="building">
  <stl-vector name="assigned_units" type-name="int32_t"
      ref-target="unit"/>
  <stl-vector name="assigned_items" type-name="int32_t"
      ref-target="item"/>
  <enum base-type="int32_t" name="type" type-name="civzone_type">
    only saved as int16
  </enum>
  <bitfield name="zone_flags" base-type="uint32_t">
    <flag-bit name="water_source"/>
    <flag-bit name="garbage_dump"/>
    <flag-bit name="sand"/>
    <flag-bit name="active"/>
    <flag-bit name="fishing"/>
    <flag-bit name="pit_pond"/>
    <flag-bit name="meeting_area"/>
    <flag-bit name="hospital"/>
    <flag-bit name="pen_pasture"/>
    <flag-bit name="clay"/>
    <flag-bit name="animal_training"/>
    <flag-bit name="gather"/>
  </bitfield>
  <int32_t init-value="-1"/>
  <int32_t init-value="-1"/>
  <int32_t name="zone_num" init-value="-1"/>
  <int32_t/>
  <bitfield name="pit_flags" base-type="uint32_t">
    <flag-bit name="is_pond"/>
    <flag-bit/>
  </bitfield>
  <int16_t name="fill_timer"/>
  <compound type-name="hospital_supplies" name="hospital"/>
  <bitfield name="gather_flags" base-type="uint32_t">
    <flag-bit name="pick_trees"/>
    <flag-bit name="pick_shrubs"/>
    <flag-bit name="gather_fallen"/>
    v0.40.14
  </bitfield>
  <int32_t name="unk_v4014_1">
    v0.40.14
  </int32_t>
  <stl-vector name="unk_v43_1">
    v0.43.01
  </stl-vector>
</class-type>

buildings.building_actual

<class-type type-name="building_actual" inherits-from="building"
    original-name="building_actualst">
  <int16_t name="construction_stage">
    0 not started, then 1 or 3 max depending on type
  </int16_t>
  <stl-vector name="contained_items">
    <pointer>
      <pointer name="item" type-name="item"/>
      <int16_t name="use_mode"/>
    </pointer>
  </stl-vector>
  <pointer name="design" type-name="building_design"/>
  <virtual-methods>
    <vmethod ret-type="bool" name="isDestroyedByItemRemoval"/>
    <vmethod ret-type="bool">
      default false
    </vmethod>
    <vmethod ret-type="bool">
      default false
    </vmethod>
  </virtual-methods>
</class-type>

buildings.building_design

<struct-type type-name="building_design">
  <int32_t name="architect" ref-target="historical_figure"/>
  <int32_t name="unk2" init-value="-1"/>
  <int16_t name="design_skill"/>
  <int32_t name="builder1" ref-target="historical_figure"/>
  <int32_t name="unk5" init-value="-1"/>
  <int16_t name="build_skill"/>
  <int16_t name="build_timer1">
    +1 per 10 frames while building
  </int16_t>
  <int32_t name="builder2" ref-target="historical_figure"/>
  <int16_t name="build_timer2"/>
  <enum base-type="int16_t" name="quality1" type-name="item_quality"/>
  <enum base-type="int16_t" name="quality2" type-name="item_quality"/>
  <bitfield name="flags" base-type="uint32_t">
    <flag-bit name="rough">
      rough gabbro road
    </flag-bit>
    <flag-bit name="built"/>
    <flag-bit name="designed"/>
  </bitfield>
  <int32_t name="hitpoints"/>
  <int32_t name="max_hitpoints"/>
</struct-type>

buildings.furnace_type

<enum-type type-name="furnace_type" base-type="int16_t">
  <enum-item name="WoodFurnace"/>
  <enum-item name="Smelter"/>
  <enum-item name="GlassFurnace"/>
  <enum-item name="Kiln"/>
  <enum-item name="MagmaSmelter"/>
  <enum-item name="MagmaGlassFurnace"/>
  <enum-item name="MagmaKiln"/>
  <enum-item name="Custom"/>
</enum-type>

buildings.building_furnacest

<class-type type-name="building_furnacest"
    inherits-from="building_actual">
  <stl-vector name="melt_remainder" type-name="int32_t"
      index-refers-to="(material-by-id 0 $)"/>
  <int16_t name="unk_108"/>
  <enum base-type="int16_t" name="type" type-name="furnace_type"/>
  <compound name="profile" type-name="workshop_profile"/>
  <int32_t name="custom_type" ref-target="building_def"/>
</class-type>

buildings.workshop_type

<enum-type type-name="workshop_type" base-type="int16_t">
  <enum-item name="Carpenters"/>
  <enum-item name="Farmers"/>
  <enum-item name="Masons"/>
  <enum-item name="Craftsdwarfs"/>
  <enum-item name="Jewelers"/>
  <enum-item name="MetalsmithsForge"/>
  <enum-item name="MagmaForge"/>
  <enum-item name="Bowyers"/>
  <enum-item name="Mechanics"/>
  <enum-item name="Siege"/>
  <enum-item name="Butchers"/>
  <enum-item name="Leatherworks"/>
  <enum-item name="Tanners"/>
  <enum-item name="Clothiers"/>
  <enum-item name="Fishery"/>
  <enum-item name="Still"/>
  <enum-item name="Loom"/>
  <enum-item name="Quern"/>
  <enum-item name="Kennels"/>
  <enum-item name="Kitchen"/>
  <enum-item name="Ashery"/>
  <enum-item name="Dyers"/>
  <enum-item name="Millstone"/>
  <enum-item name="Custom"/>
  <enum-item name="Tool"/>
</enum-type>

buildings.workshop_profile

<struct-type type-name="workshop_profile">
  <stl-vector name="permitted_workers" type-name="int32_t"
      ref-target="unit"/>
  <int32_t name="min_level"/>
  <int32_t name="max_level" init-value="3000"/>
  <compound name="links" type-name="stockpile_links"/>
  <int32_t name="max_general_orders"/>
  <bool name="block_general_orders"/>
  <padding size="3"/>
  <static-array name="blocked_labors" type-name="bool" count="94"
      index-enum="unit_labor"/>
</struct-type>

buildings.building_workshopst

<class-type type-name="building_workshopst"
    inherits-from="building_actual">
  <enum base-type="int16_t" name="type" type-name="workshop_type"/>
  <compound name="profile" type-name="workshop_profile"/>
  <compound name="machine" type-name="machine_info"/>
  <int32_t name="custom_type" ref-target="building_def"/>
</class-type>

buildings.building_animaltrapst

<class-type type-name="building_animaltrapst"
    inherits-from="building_actual">
  <int16_t name="bait_type" init-value="-1"/>
  <int16_t name="fill_timer"/>
</class-type>

buildings.building_archerytargetst

<class-type type-name="building_archerytargetst"
    inherits-from="building_actual">
  <enum name="archery_direction" base-type="int8_t">
    <enum-item name="TopToBottom"/>
    <enum-item name="BottomToTop"/>
    <enum-item name="LeftToRight"/>
    <enum-item name="RightToLeft"/>
  </enum>
</class-type>

buildings.building_armorstandst

<class-type type-name="building_armorstandst"
    inherits-from="building_actual">
  <int16_t name="unk_c0"/>
  <stl-vector name="squads" pointer-type="building_squad_use"/>
  <int32_t name="specific_squad" ref-target="squad"/>
  <int32_t name="specific_position" init-value="-1"/>
</class-type>

buildings.building_bars_verticalst

<class-type type-name="building_bars_verticalst"
    inherits-from="building_actual">
  <compound name="gate_flags" type-name="gate_flags" init-value="1"/>
  <int8_t name="timer"/>
</class-type>

buildings.building_bars_floorst

<class-type type-name="building_bars_floorst"
    inherits-from="building_actual">
  <compound name="gate_flags" type-name="gate_flags" init-value="1"/>
  <int8_t name="timer"/>
</class-type>

buildings.building_users

<struct-type type-name="building_users">
  <stl-vector name="unit" type-name="int32_t" ref-target="unit"/>
  <stl-vector name="mode" type-name="int16_t"/>
</struct-type>

buildings.building_bedst

<class-type type-name="building_bedst"
    inherits-from="building_actual">
  <bitfield name="bed_flags" base-type="uint16_t">
    <flag-bit name="barracks"/>
    <flag-bit name="dormitory"/>
  </bitfield>
  <stl-vector name="squads" pointer-type="building_squad_use"/>
  <int32_t name="specific_squad" ref-target="squad"/>
  <int32_t name="specific_position" init-value="-1"/>
  <compound name="users" type-name="building_users"/>
</class-type>

buildings.building_bookcasest

<class-type type-name="building_bookcasest"
    inherits-from="building_actual"/>

buildings.building_boxst

<class-type type-name="building_boxst"
    inherits-from="building_actual">
  <int16_t/>
  <stl-vector name="squads" pointer-type="building_squad_use"/>
  <int32_t name="specific_squad" ref-target="squad"/>
  <int32_t name="specific_position" init-value="-1"/>
</class-type>

buildings.building_bridgest

<class-type type-name="building_bridgest"
    inherits-from="building_actual">
  <compound name="gate_flags" type-name="gate_flags" init-value="1"/>
  <int8_t name="timer"/>
  <enum name="direction" base-type="int8_t">
    <enum-item name="Retracting" value="-1"/>
    <enum-item name="Left"/>
    <enum-item name="Right"/>
    <enum-item name="Up"/>
    <enum-item name="Down"/>
  </enum>
  <int32_t name="material_amount"/>
</class-type>

buildings.building_cabinetst

<class-type type-name="building_cabinetst"
    inherits-from="building_actual">
  <int16_t/>
  <stl-vector name="squads" pointer-type="building_squad_use"/>
  <int32_t name="specific_squad" ref-target="squad"/>
  <int32_t name="specific_position" init-value="-1"/>
</class-type>

buildings.building_cagest

<class-type type-name="building_cagest"
    inherits-from="building_actual">
  <stl-vector name="assigned_units" type-name="int32_t"
      ref-target="unit"/>
  <stl-vector name="assigned_items" type-name="int32_t"
      ref-target="item"/>
  <bitfield base-type="uint16_t" name="cage_flags">
    <flag-bit name="triggered"/>
  </bitfield>
  <int16_t name="fill_timer"/>
</class-type>

buildings.building_chainst

<class-type type-name="building_chainst"
    inherits-from="building_actual">
  <pointer name="assigned" type-name="unit"/>
  <pointer name="chained" type-name="unit"/>
  <bitfield base-type="uint16_t" name="chain_flags">
    <flag-bit name="triggered"/>
  </bitfield>
</class-type>

buildings.building_chairst

<class-type type-name="building_chairst"
    inherits-from="building_actual">
  <int16_t/>
  <compound name="users" type-name="building_users"/>
</class-type>

buildings.building_coffinst

<class-type type-name="building_coffinst"
    inherits-from="building_actual">
  <bitfield name="burial_mode" base-type="uint16_t">
    <flag-bit name="allow_burial"/>
    <flag-bit name="no_pets"/>
    <flag-bit name="no_citizens"/>
  </bitfield>
</class-type>

buildings.construction_type

<enum-type type-name="construction_type" base-type="int16_t">
  <enum-item name="NONE" value="-1">
    unused
  </enum-item>
  <enum-item name="Fortification"/>
  <enum-item name="Wall"/>
  <enum-item name="Floor"/>
  <enum-item name="UpStair"/>
  <enum-item name="DownStair"/>
  <enum-item name="UpDownStair"/>
  <enum-item name="Ramp"/>
  <enum-item name="TrackN"/>
  <enum-item name="TrackS"/>
  <enum-item name="TrackE"/>
  <enum-item name="TrackW"/>
  <enum-item name="TrackNS"/>
  <enum-item name="TrackNE"/>
  <enum-item name="TrackNW"/>
  <enum-item name="TrackSE"/>
  <enum-item name="TrackSW"/>
  <enum-item name="TrackEW"/>
  <enum-item name="TrackNSE"/>
  <enum-item name="TrackNSW"/>
  <enum-item name="TrackNEW"/>
  <enum-item name="TrackSEW"/>
  <enum-item name="TrackNSEW"/>
  <enum-item name="TrackRampN"/>
  <enum-item name="TrackRampS"/>
  <enum-item name="TrackRampE"/>
  <enum-item name="TrackRampW"/>
  <enum-item name="TrackRampNS"/>
  <enum-item name="TrackRampNE"/>
  <enum-item name="TrackRampNW"/>
  <enum-item name="TrackRampSE"/>
  <enum-item name="TrackRampSW"/>
  <enum-item name="TrackRampEW"/>
  <enum-item name="TrackRampNSE"/>
  <enum-item name="TrackRampNSW"/>
  <enum-item name="TrackRampNEW"/>
  <enum-item name="TrackRampSEW"/>
  <enum-item name="TrackRampNSEW"/>
</enum-type>

buildings.building_constructionst

<class-type type-name="building_constructionst"
    inherits-from="building_actual">
  <enum name="type" type-name="construction_type"
      base-type="int16_t"/>
</class-type>

buildings.building_doorst

<class-type type-name="building_doorst"
    inherits-from="building_actual">
  <compound name="door_flags" type-name="door_flags"
      init-value="0x50"/>
  <int16_t name="close_timer"/>
</class-type>

buildings.building_farmplotst

<class-type type-name="building_farmplotst"
    inherits-from="building_actual">
  <static-array name="plant_id" count="4">
    <int16_t ref-target="plant_raw"/>
  </static-array>
  <int32_t name="material_amount"/>
  <int32_t name="seasonal_fertilize"/>
  <int8_t init-value="-1"/>
  <int32_t name="current_fertilization"/>
  <int32_t name="max_fertilization"/>
  <int16_t name="terrain_purge_timer" init-value="500"/>
</class-type>

buildings.building_floodgatest

<class-type type-name="building_floodgatest"
    inherits-from="building_actual">
  <compound name="gate_flags" type-name="gate_flags" init-value="1"/>
  <int8_t name="timer"/>
</class-type>

buildings.building_grate_floorst

<class-type type-name="building_grate_floorst"
    inherits-from="building_actual">
  <compound name="gate_flags" type-name="gate_flags" init-value="1"/>
  <int8_t name="timer"/>
</class-type>

buildings.building_grate_wallst

<class-type type-name="building_grate_wallst"
    inherits-from="building_actual">
  <compound name="gate_flags" type-name="gate_flags" init-value="1"/>
  <int8_t name="timer"/>
</class-type>

buildings.building_hatchst

<class-type type-name="building_hatchst"
    inherits-from="building_actual">
  <compound name="door_flags" type-name="door_flags"
      init-value="0x50"/>
  <int16_t name="close_timer"/>
</class-type>

buildings.hive_flags

<bitfield-type type-name="hive_flags" base-type="uint32_t">
  <flag-bit name="do_install"/>
  <flag-bit name="do_gather"/>
  <flag-bit name="ready_split"/>
</bitfield-type>

buildings.building_hivest

<class-type type-name="building_hivest"
    inherits-from="building_actual">
  <compound name="hive_flags" type-name="hive_flags"/>
  <int32_t name="split_timer">
    up to 100800
  </int32_t>
  <int32_t name="activity_timer">
    up to 100800000; checks timer%hive_product.time[i]==0
  </int32_t>
  <int32_t name="install_timer">
    down from 1200
  </int32_t>
  <int32_t name="gather_timer">
    down from 1200
  </int32_t>
</class-type>

buildings.building_instrumentst

<class-type type-name="building_instrumentst"
    inherits-from="building_actual">
  <int32_t/>
</class-type>

buildings.building_nestst

<class-type type-name="building_nestst"
    inherits-from="building_actual"/>

buildings.building_nest_boxst

<class-type type-name="building_nest_boxst"
    inherits-from="building_actual">
  <int32_t name="claimed_by" ref-target="unit"/>
  <int32_t/>
</class-type>

buildings.building_roadst

<class-type type-name="building_roadst"
    inherits-from="building_actual"/>

buildings.building_road_dirtst

<class-type type-name="building_road_dirtst"
    inherits-from="building_roadst">
  <int32_t name="material_amount"/>
</class-type>

buildings.building_road_pavedst

<class-type type-name="building_road_pavedst"
    inherits-from="building_roadst">
  <int32_t name="material_amount"/>
  <int16_t name="terrain_purge_timer" init-value="500"/>
</class-type>

buildings.shop_type

<enum-type type-name="shop_type" base-type="int16_t">
  <enum-item name="GeneralStore"/>
  <enum-item name="CraftsMarket"/>
  <enum-item name="ClothingShop"/>
  <enum-item name="ExoticClothingShop"/>
</enum-type>

buildings.building_shopst

<class-type type-name="building_shopst"
    inherits-from="building_actual">
  <pointer type-name="unit" name="owner"/>
  <int32_t name="timer">
    increments until reaching 200,000,000
  </int32_t>
  <bitfield name="shop_flags" base-type="int16_t" init-value="1">
    <flag-bit name="for_sale"/>
  </bitfield>
  <enum base-type="int16_t" name="type" type-name="shop_type"/>
</class-type>

buildings.siegeengine_type

<enum-type type-name="siegeengine_type" base-type="int16_t">
  <enum-item name="Catapult"/>
  <enum-item name="Ballista"/>
</enum-type>

buildings.building_siegeenginest

<class-type type-name="building_siegeenginest"
    inherits-from="building_actual">
  <enum base-type="int16_t" name="type" type-name="siegeengine_type"/>
  <enum name="facing" base-type="int8_t">
    <enum-item name="Left"/>
    <enum-item name="Up"/>
    <enum-item name="Right"/>
    <enum-item name="Down"/>
  </enum>
  <enum name="action" base-type="int8_t">
    <enum-item name="NotInUse"/>
    <enum-item name="PrepareToFire"/>
    <enum-item name="FireAtWill"/>
  </enum>
  <int8_t name="fire_timer"/>
  <int16_t name="fill_timer"/>
</class-type>

buildings.building_slabst

<class-type type-name="building_slabst"
    inherits-from="building_actual">
  <int16_t/>
</class-type>

buildings.building_statuest

<class-type type-name="building_statuest"
    inherits-from="building_actual">
  <int16_t/>
</class-type>

buildings.building_supportst

<class-type type-name="building_supportst"
    inherits-from="building_actual">
  <bitfield base-type="uint16_t" name="support_flags">
    <flag-bit name="triggered"/>
  </bitfield>
</class-type>

buildings.building_tablest

<class-type type-name="building_tablest"
    inherits-from="building_actual">
  <bitfield name="table_flags" base-type="int16_t">
    <flag-bit name="meeting_hall"/>
  </bitfield>
  <compound name="users" type-name="building_users"/>
</class-type>

buildings.building_traction_benchst

<class-type type-name="building_traction_benchst"
    inherits-from="building_actual">
  <int16_t/>
  <compound name="users" type-name="building_users"/>
</class-type>

buildings.building_tradedepotst

<class-type type-name="building_tradedepotst"
    inherits-from="building_actual">
  <bitfield name="trade_flags" base-type="uint32_t">
    <flag-bit name="trader_requested"/>
    <flag-bit name="anyone_can_trade"/>
  </bitfield>
  <int8_t name="accessible"/>
</class-type>

buildings.trap_type

<enum-type type-name="trap_type" base-type="int16_t">
  <enum-item name="Lever"/>
  <enum-item name="PressurePlate"/>
  <enum-item name="CageTrap"/>
  <enum-item name="StoneFallTrap"/>
  <enum-item name="WeaponTrap"/>
  <enum-item name="TrackStop"/>
</enum-type>

buildings.pressure_plate_info

<struct-type type-name="pressure_plate_info">
  <int32_t name="unit_min" init-value="50000"/>
  <int32_t name="unit_max" init-value="200000"/>
  <int8_t name="water_min" init-value="1"/>
  <int8_t name="water_max" init-value="7"/>
  <int8_t name="magma_min" init-value="1"/>
  <int8_t name="magma_max" init-value="7"/>
  <int32_t name="track_min" init-value="1">
    v0.34.08
  </int32_t>
  <int32_t name="track_max" init-value="2000">
    v0.34.08
  </int32_t>
  <bitfield name="flags" init-value="0x10">
    <flag-bit name="units"/>
    <flag-bit name="water"/>
    <flag-bit name="magma"/>
    <flag-bit name="citizens"/>
    <flag-bit name="resets"/>
    <flag-bit name="track"/>
  </bitfield>
</struct-type>

buildings.building_trapst

<class-type type-name="building_trapst"
    inherits-from="building_actual">
  <enum base-type="int16_t" name="trap_type" type-name="trap_type"/>
  <uint8_t name="state">
    !=0 = pulled, tripped/needs reloading
  </uint8_t>
  <int16_t name="ready_timeout">
    plate not active if > 0
  </int16_t>
  <int16_t name="fill_timer"/>
  <bitfield base-type="uint16_t" name="stop_flags">
    <flag-bit name="disabled"/>
    <flag-bit name="disabling"/>
    <flag-bit name="enabling"/>
  </bitfield>
  <stl-vector name="linked_mechanisms" pointer-type="item"/>
  <stl-vector name="observed_by_civs" type-name="int32_t"
      ref-target="historical_entity"/>
  <compound name="profile" type-name="workshop_profile"/>
  <compound name="plate_info" type-name="pressure_plate_info"/>
  <int32_t name="friction" init-value="50000">
    v0.34.08
  </int32_t>
  <int32_t name="use_dump">
    v0.34.08
  </int32_t>
  <int32_t name="dump_x_shift">
    v0.34.08
  </int32_t>
  <int32_t name="dump_y_shift">
    v0.34.08
  </int32_t>
  <int8_t name="stop_trigger_timer">
    v0.34.08
  </int8_t>
</class-type>

buildings.building_wagonst

<class-type type-name="building_wagonst"
    inherits-from="building_actual"/>

buildings.building_weaponst

<class-type type-name="building_weaponst"
    inherits-from="building_actual">
  <compound name="gate_flags" type-name="gate_flags" init-value="1"/>
  <int8_t name="timer"/>
</class-type>

buildings.building_squad_use

<struct-type type-name="building_squad_use">
  <int32_t name="squad_id" ref-target="squad"/>
  <compound name="mode" type-name="squad_use_flags"/>
</struct-type>

buildings.building_weaponrackst

<class-type type-name="building_weaponrackst"
    inherits-from="building_actual">
  <int16_t name="unk_c0"/>
  <stl-vector name="squads" pointer-type="building_squad_use"/>
  <int32_t name="specific_squad" ref-target="squad"/>
</class-type>

buildings.building_wellst

<class-type type-name="building_wellst"
    inherits-from="building_actual">
  <bitfield name="well_flags" base-type="int16_t">
    <flag-bit name="lowering"/>
    <flag-bit name="just_raised"/>
  </bitfield>
  <int8_t/>
  <int16_t name="bucket_z"/>
  <int8_t name="bucket_timer">
    0-9; counts up when raising, down when lowering
  </int8_t>
  <int16_t name="check_water_timer"/>
</class-type>

buildings.building_windowst

<class-type type-name="building_windowst"
    inherits-from="building_actual">
  <int16_t/>
</class-type>

buildings.building_window_glassst

<class-type type-name="building_window_glassst"
    inherits-from="building_windowst"/>

buildings.building_window_gemst

<class-type type-name="building_window_gemst"
    inherits-from="building_windowst"/>