machines

machines.machine_type

<enum-type type-name="machine_type">
  <enum-item name="standard"/>
</enum-type>

machines.machine_info

<struct-type type-name="machine_info">
  <int32_t name="machine_id" ref-target="machine"/>
  <bitfield name="flags">
    <flag-bit name="frozen"/>
  </bitfield>
</struct-type>

machines.power_info

<struct-type type-name="power_info">
  <int32_t name="produced"/>
  <int32_t name="consumed"/>
</struct-type>

machines.machine_conn_modes

<bitfield-type type-name="machine_conn_modes" base-type="uint8_t">
  <flag-bit name="up"/>
  <flag-bit name="down"/>
  <flag-bit name="right"/>
  <flag-bit name="left"/>
  <flag-bit name="z_up"/>
  <flag-bit name="z_down"/>
</bitfield-type>

machines.machine_tile_set

<struct-type type-name="machine_tile_set">
  <compound name="tiles" type-name="coord_path"/>
  <stl-vector name="can_connect">
    <compound type-name="machine_conn_modes"/>
  </stl-vector>
</struct-type>

machines.machine

<class-type type-name="machine" original-name="machinest"
    instance-vector="$global.world.machines.all" key-field="id">
  <int32_t name="x"/>
  <int32_t name="y"/>
  <int32_t name="z"/>
  <int32_t name="id"/>
  <stl-vector name="components">
    <pointer>
      <int32_t name="building_id" ref-target="building"/>
      <stl-vector name="connections" type-name="int32_t">
        indices into the same component vector
      </stl-vector>
    </pointer>
  </stl-vector>
  <int32_t name="cur_power"/>
  <int32_t name="min_power"/>
  <int8_t name="visual_phase"/>
  <int16_t name="phase_timer"/>
  <bitfield name="flags">
    <flag-bit name="active"/>
    <flag-bit name="frozen">
      ?
    </flag-bit>
    <flag-bit name="unfreeze">
      ?
    </flag-bit>
  </bitfield>
  <virtual-methods>
    <vmethod ret-type="machine_type" name="getType"/>
    <vmethod name="moveMachine">
      <int16_t name="x"/>
      <int16_t name="y"/>
      <int16_t name="z"/>
    </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 is-destructor="true"/>
  </virtual-methods>
</class-type>

machines.machine_standardst

<class-type type-name="machine_standardst" inherits-from="machine">

</class-type>

machines.building_axle_horizontalst

<class-type type-name="building_axle_horizontalst"
    inherits-from="building_actual">
  <compound name="machine" type-name="machine_info"/>
  <bool name="is_vertical"/>
</class-type>

machines.building_axle_verticalst

<class-type type-name="building_axle_verticalst"
    inherits-from="building_actual">
  <compound name="machine" type-name="machine_info"/>
</class-type>

machines.building_gear_assemblyst

<class-type type-name="building_gear_assemblyst"
    inherits-from="building_actual">
  <compound name="machine" type-name="machine_info"/>
  <bitfield name="gear_flags">
    <flag-bit name="disengaged"/>
  </bitfield>
</class-type>

machines.building_windmillst

<class-type type-name="building_windmillst"
    inherits-from="building_actual">
  <compound name="machine" type-name="machine_info"/>
  <int16_t name="orient_x" init-value="-1"/>
  <int16_t name="orient_y"/>
  <int16_t name="is_working"/>
  <bool name="visual_rotated"/>
  <int16_t name="rotate_timer"/>
  <int16_t name="orient_timer"/>
</class-type>

machines.building_water_wheelst

<class-type type-name="building_water_wheelst"
    inherits-from="building_actual">
  <compound name="machine" type-name="machine_info"/>
  <bool name="is_vertical"/>
  <bool name="gives_power"/>
</class-type>

machines.screw_pump_direction

<enum-type type-name="screw_pump_direction" base-type="int8_t">
  <enum-item name="FromNorth"/>
  <enum-item name="FromEast"/>
  <enum-item name="FromSouth"/>
  <enum-item name="FromWest"/>
</enum-type>

machines.building_screw_pumpst

<class-type type-name="building_screw_pumpst"
    inherits-from="building_actual">
  <compound name="machine" type-name="machine_info"/>
  <uint8_t name="pump_energy">
    decreases by 1 every frame. powering or manually pumping maintains
     near 100
  </uint8_t>
  <enum name="direction" base-type="int8_t"
      type-name="screw_pump_direction"/>
  <bool name="pump_manually"/>
</class-type>

machines.building_rollersst

<class-type type-name="building_rollersst"
    inherits-from="building_actual">
  <compound name="machine" type-name="machine_info"/>
  <enum name="direction" base-type="int32_t"
      type-name="screw_pump_direction"/>
  <int32_t name="speed" init-value="50000"/>
</class-type>