Skip to content

Commit

Permalink
Investigate improvement vmethods.
Browse files Browse the repository at this point in the history
  • Loading branch information
angavrilov committed Sep 15, 2012
1 parent ed50142 commit b31b3d2
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 17 deletions.
6 changes: 4 additions & 2 deletions df.itemimprovements.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<int16_t name='mat_type' ref-target='material' aux-value='$$.mat_index'/>
<int32_t name='mat_index'/>
<int32_t name='maker' ref-target='historical_figure'/>
<int32_t/>
<int32_t name='masterpiece_event' ref-target='history_event'/>
<enum base-type='int16_t' name='quality' type-name='item_quality'/>
<enum base-type='int32_t' name="skill_rating" type-name='skill_rating'
comment='at the moment of creation'/>
Expand Down Expand Up @@ -67,7 +67,9 @@
</class-type>

<class-type type-name='itemimprovement_coveredst' inherits-from='itemimprovement'>
<int32_t name='is_glazed'/>
<bitfield name='cover_flags'>
<flag-bit name='glazed'/>
</bitfield>
<int32_t name='shape' ref-target='descriptor_shape'/>
</class-type>

Expand Down
14 changes: 13 additions & 1 deletion df.items.xml
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,19 @@
<vmethod ret-type='bool' name='isLiquid'/>
<vmethod/>
<vmethod ret-type='int32_t' name='getVolume' comment='for putting in containers, building clutter'/>
<vmethod name='addImprovementFromJob'/>
<vmethod name='addImprovementFromJob'>
<ret-type><pointer type-name='itemimprovement'/></ret-type>
<enum base-type='int32_t' type-name='improvement_type'/>
<pointer type-name='job'/>
<pointer type-name='unit'/>
<int16_t name='mat_type'/>
<int32_t name='mat_index'/>
<int32_t name='shape' ref-target='descriptor_shape'/>
<pointer type-name='historical_entity'/>
<pointer type-name='world_site'/>
<int16_t name='unk' comment='used to compute quality if !job||!unit'/>
<bool name='unshaped' comment='glazed'/>
</vmethod>
<vmethod ret-type='bool' name='isWeapon'/>

-- 85
Expand Down
4 changes: 1 addition & 3 deletions df.jobs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@
<flag-bit/>
<flag-bit name='by_manager'/>
<flag-bit name='store_item'/>
<flag-bit/>
<flag-bit/>
<flag-bit/>
<flag-bit name='quality' count='3' comment='set by improvement code'/>
</bitfield-type>

<struct-type type-name='job' key-field='id'>
Expand Down
31 changes: 22 additions & 9 deletions df.reaction-raws.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@

<code-helper name='describe'>$.code</code-helper>

<int32_t name='quantity'/>

<compound name="flags" type-name='reaction_reagent_flags'/>

<virtual-methods>
<vmethod ret-type='reaction_reagent_type' name='getType'/>
<vmethod/>
Expand All @@ -59,7 +63,11 @@
<vmethod/>

<vmethod/>
<vmethod/>
<vmethod ret-type='bool' name='matches'>
<pointer type-name='item'/>
<pointer type-name='reaction' comment='or maybe reaction code string ref'/>
<int32_t name='index' ref-target='reaction'/>
</vmethod>
<vmethod/>
<vmethod ret-type='bool' name='isLyeBearing'/>
</virtual-methods>
Expand All @@ -72,10 +80,6 @@
</bitfield-type>

<class-type type-name='reaction_reagent_itemst' inherits-from='reaction_reagent'>
<int32_t name='quantity'/>

<compound name="flags" type-name='reaction_reagent_flags'/>

<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'/>
Expand Down Expand Up @@ -116,7 +120,16 @@
<vmethod name='resolveTokens'>
<int32_t name='reactionID'/>
</vmethod>
<vmethod/>
<vmethod name='produce'>
<pointer type-name='unit'/>
<pointer name='out_items'><stl-vector pointer-type='item'/></pointer>
<pointer name='in_reag'><stl-vector pointer-type='reaction_reagent'/></pointer>
<pointer name='in_items'><stl-vector pointer-type='item'/></pointer>
<int32_t name='quantity'/>
<enum type-name='job_skill' base-type='int16_t'/>
<pointer type-name='historical_entity'/>
<pointer type-name='world_site'/>
</vmethod>
<vmethod name='getDescription' comment='used in Adventurer mode reactions?'>
<pointer type-name='stl-string' name='desc'/>
</vmethod>
Expand Down Expand Up @@ -157,9 +170,9 @@
</class-type>

<enum-type type-name='reaction_product_improvement_flags'>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item name='GET_MATERIAL_SAME'/>
<enum-item name='GET_MATERIAL_PRODUCT'/>
<enum-item name='GLAZED'/>
</enum-type>

<class-type type-name='reaction_product_item_improvementst' inherits-from='reaction_product'>
Expand Down
4 changes: 2 additions & 2 deletions df.viewscreen.xml
Original file line number Diff line number Diff line change
Expand Up @@ -550,10 +550,10 @@
<int32_t/>
<int32_t/>?
<compound>
<static-array cont='6'>
<static-array count='6'>
<stl-vector/>
</static-array>
<static-array cont='6'>
<static-array count='6'>
<stl-vector/>
</static-array>
</compound>
Expand Down

0 comments on commit b31b3d2

Please sign in to comment.