Skip to content

Commit

Permalink
Add structure definition for custom building items.
Browse files Browse the repository at this point in the history
  • Loading branch information
angavrilov committed May 8, 2012
1 parent 85ad31c commit 8f25827
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 9 deletions.
28 changes: 27 additions & 1 deletion df.building-raws.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<bool name='needs_magma'/>

<stl-vector name="build_items">
<pointer/>
<pointer type-name='building_def_item'/>
</stl-vector>

<int32_t name="dim_x"/>
Expand Down Expand Up @@ -62,6 +62,32 @@
</virtual-methods>
</class-type>

<struct-type type-name='building_def_item'>
<enum base-type='int16_t' name='item_type' type-name='item_type'/>
<int16_t name='item_subtype' refers-to='(item-subtype-target $$._parent.item_type $)'/>
<int16_t name='mat_type' ref-target='material' aux-value='$$.mat_index'/>
<int16_t name='mat_index' init-value='-1'/>

<stl-string name='reaction_class'/>
<stl-string name='has_material_reaction_product'/>

<compound name='flags1' type-name='job_item_flags1'/>
<compound name='flags2' type-name='job_item_flags2'/>
<compound name='flags3' type-name='job_item_flags3'/>
<uint32_t name='flags4'/>
<uint32_t name='flags5'/>

<int32_t name='metal_ore' ref-target='inorganic_raw'/>
<int32_t name='min_dimension'/>

<int32_t name='quantity'/>
<enum base-type='int16_t' name='has_tool_use' type-name='tool_uses'/>

<static-array type-name='stl-string' name='item_str' count='2'/>
<static-array type-name='stl-string' name='material_str' count='3'/>
<stl-string name='metal_ore_str'/>
</struct-type>

<class-type type-name='building_def_workshopst' inherits-from='building_def'/>
<class-type type-name='building_def_furnacest' inherits-from='building_def'/>
</data-definition>
Expand Down
12 changes: 6 additions & 6 deletions df.jobs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,8 @@

<compound name='flags2' type-name='job_item_flags2'/>
<compound name='flags3' type-name='job_item_flags3'/>
<int32_t name='unk2'/>
<int32_t name='unk3'/>
<uint32_t name='flags4'/>
<uint32_t name='flags5'/>

-- Custom:
<int32_t name='metal_ore' ref-target='inorganic_raw'/>
Expand Down Expand Up @@ -291,11 +291,11 @@
<compound name="flags3" type-name='job_item_flags3'/>
<bool name="use_flags3"/>

<int32_t name="unk2"/>
<bool name="use_unk2"/>
<uint32_t name='flags4'/>
<bool name="use_flags4"/>

<int32_t name="unk3"/>
<bool name="use_unk3"/>
<uint32_t name='flags5'/>
<bool name="use_flags5"/>

<stl-string name='reaction_class'/>
<stl-string name='has_material_reaction_product'/>
Expand Down
4 changes: 2 additions & 2 deletions df.reaction-raws.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@
<compound name='flags1' type-name='job_item_flags1'/>
<compound name='flags2' type-name='job_item_flags2'/>
<compound name='flags3' type-name='job_item_flags3'/>
<int32_t name='unk1'/>
<int32_t name='unk2'/>
<uint32_t name='flags4'/>
<uint32_t name='flags5'/>

<int32_t name='metal_ore' ref-target='inorganic_raw'/>
<int32_t name='min_dimension'/>
Expand Down

0 comments on commit 8f25827

Please sign in to comment.