Skip to content

Commit

Permalink
Add/update vtables for several classes
Browse files Browse the repository at this point in the history
  • Loading branch information
quietust committed Jan 14, 2012
1 parent f9c6d10 commit c500259
Show file tree
Hide file tree
Showing 7 changed files with 176 additions and 8 deletions.
12 changes: 12 additions & 0 deletions df.building-raws.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,18 @@
<stl-string name="labor_description"/>

<int32_t name="build_stages"/>

<virtual-methods>
<vmethod name='parseRaws'>
<pointer/>
<pointer/>
<pointer/>
<pointer/>
</vmethod>
<vmethod name='categorize' comment='add to world.raws.buildings.whatever'/>
<vmethod name='finalize'/>
<vmethod is-destructor='true'/>
</virtual-methods>
</class-type>

<class-type type-name='building_def_workshopst' inherits-from='building_def'/>
Expand Down
11 changes: 11 additions & 0 deletions df.item-raws.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,17 @@
<int16_t name="subtype"/>

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

<virtual-methods>
<vmethod name='parseRaws'>
<pointer/>
<pointer/>
<pointer/>
</vmethod>
<vmethod name='categorize' comment='add to world.raws.itemdefs.whatever'/>
<vmethod name='finalize' comment='calculate stuff like base value'/>
<vmethod is-destructor='true'/>
</virtual-methods>
</class-type>

<enum-type type-name='ammo_flags'>
Expand Down
19 changes: 19 additions & 0 deletions df.machines.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<data-definition>
-- MACHINE

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

<struct-type type-name='machine_info'>
<int32_t name="machine_id" ref-target='machine'/>
<int32_t/>
Expand Down Expand Up @@ -34,6 +38,21 @@
<int16_t name="phase_timer"/>

<int32_t name="is_active"/>

<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 comment='file_compressorst'/> </vmethod>
<vmethod name='read_file'>
<pointer comment='file_compressorst'/>
<int32_t name='loadversion'/>
</vmethod>
<vmethod is-destructor='true'/>
</virtual-methods>
</class-type>

<class-type type-name='machine_standardst' inherits-from='machine'>
Expand Down
55 changes: 55 additions & 0 deletions df.meeting.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@
<int32_t name='unk2'/>
</struct-type>

<enum-type type-name='activity_event_type'>
<enum-item name='TrainingSession'/>
<enum-item name='CombatTraining'/>
<enum-item name='SkillDemonstration'/>
<enum-item name='IndividualSkillDrill'/>
<enum-item name='Sparring'/>
<enum-item name='RangedPractice'/>
</enum-type>

<class-type type-name='activity_event' original-name='activity_eventst'>
<int32_t name='event_id'
comment='mostly, but not always, the index in activity.events'/>
Expand Down Expand Up @@ -74,6 +83,52 @@
-- These are equal to the ones above:
<int32_t name='activity_id2' ref-target='activity_entry'/>
<int32_t name='event_id2'/>

<virtual-methods>
<vmethod ret-type='activity_event_type' name='getType'/>
<vmethod name='write_file'> <pointer comment='file_compressorst'/> </vmethod>
<vmethod name='read_file'>
<pointer comment='file_compressorst'/>
<int32_t name='loadversion'/>
</vmethod>
<vmethod is-destructor='true'/>
<vmethod ret-type='bool' comment='returns true if hist_figure_ids empty or if various subclass fields are uninitialized'/>
<vmethod comment='returns -1'/>
<vmethod comment='does nothing'> <pointer/> </vmethod>
<vmethod name='getHistFigVector'>
<ret-type> <stl-vector> <int32_t ref-target='historical_figure'/> </stl-vector> </ret-type>
</vmethod>
<vmethod/>
<vmethod/>
<vmethod/>
<vmethod/>
<vmethod/>
<vmethod/>
<vmethod name='setSkillDemoUnk5'>
<int16_t name='unk5'/>
</vmethod>
<vmethod name='setSkillDemoUnk789'>
<int32_t name='unk7'/>
<int32_t name='unk8'/>
<int32_t name='unk9'/>
</vmethod>
<vmethod name='adjustUnkA' comment='combat_training adjusts unk5, skill_demonstration adjusts unk6, others do nothing'>
<int32_t name='amount'/>
</vmethod>
<vmethod name='getOrganizer' comment='or perhaps somebody else - only works for combat_training and skill_demonstration'>
<pointer type-name='int32_t' name='hist_figure_id'/>
<pointer type-name='int32_t' name='unit_id'/>
</vmethod>
<vmethod name='getBuilding' comment='returns pointer to building_id'>
<ret-type><pointer type-name='int32_t'/></ret-type>
</vmethod>
<vmethod/>
<vmethod/>
<vmethod name='getName'>
<int32_t/>
<pointer type-name='stl-string' name='str'/>
</vmethod>
</virtual-methods>
</class-type>

<class-type type-name='activity_event_individual_skill_drillst' inherits-from='activity_event'>
Expand Down
24 changes: 24 additions & 0 deletions df.projectile.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
<data-definition>
<enum-type type-name='projectile_type'>
<enum-item name='Item'/>
<enum-item name='Unit'/>
<enum-item name='Magic'/>
</enum-type>

<struct-type type-name='proj_list_link'>
<pointer name='item' type-name='projectile'/>
<pointer name='prev' type-name='proj_list_link'/>
Expand Down Expand Up @@ -39,6 +45,24 @@
<int32_t name='unk21'/>
<int32_t name='unk22'/>
<int32_t name='unk23'/>

<virtual-methods>
<vmethod ret-type='projectile_type' name='getType'/>
<vmethod ret-type='bool'>
<bool/>
</vmethod>
<vmethod ret-type='bool'/>
<vmethod name='write_file'> <pointer comment='file_compressorst'/> </vmethod>
<vmethod name='read_file'>
<pointer comment='file_compressorst'/>
<int32_t name='loadversion'/>
</vmethod>
<vmethod>
<pointer/>
</vmethod>
<vmethod ret-type='bool'/>
<vmethod is-destructor='true'/>
</virtual-methods>
</class-type>

<class-type type-name='proj_itemst' inherits-from='projectile'>
Expand Down
31 changes: 23 additions & 8 deletions df.reaction-raws.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,27 @@
<int32_t name="index"/>
</struct-type>

<enum-type type-name='reaction_reagent_type'>
<enum-item name='item'/>
</enum-type>

<class-type type-name='reaction_reagent' original-name='reaction_reagentst'>
<stl-string name="code"/>

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

<virtual-methods>
<vmethod ret-type='reaction_reagent_type' name='getType'/>
<vmethod/>
<vmethod is-destructor='true'/>
<vmethod name='resolveTokens'>
<int32_t name='reactionID'/>
</vmethod>
<vmethod/>
<vmethod/>
<vmethod/>
<vmethod/>
<vmethod/>
<vmethod/>
<vmethod/>
<vmethod/>
<vmethod ret-type='bool' name='isLyeBearing'/>
</virtual-methods>
</class-type>

Expand Down Expand Up @@ -96,13 +102,22 @@
</stl-vector>
</class-type>

<enum-type type-name='reaction_product_type'>
<enum-item name='item'/>
<enum-item name='improvement'/>
</enum-type>

<class-type type-name='reaction_product' original-name='reaction_productst'>
<virtual-methods>
<vmethod ret-type='reaction_product_type' name='getType'/>
<vmethod name='resolveTokens'>
<int32_t name='reactionID'/>
</vmethod>
<vmethod/>
<vmethod/>
<vmethod/>
<vmethod/>
<vmethod/>
<vmethod name='getDescription' comment='used in Adventurer mode reactions?'>
<pointer type-name='stl-string' name='desc'/>
</vmethod>
<vmethod is-destructor='true'/>
</virtual-methods>
</class-type>

Expand Down
32 changes: 32 additions & 0 deletions df.ui-menus.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,29 @@
<int16_t name="count_provided"/>
</struct-type>

<enum-type type-name='build_req_choice_type'>
<enum-item name='General'/>
<enum-item name='Specific'/>
</enum-type>

<class-type type-name='build_req_choicest'>
<comment>One choice in the build item selector.</comment>
<int32_t name="distance"/>

<virtual-methods>
<vmethod ret-type='build_req_choice_type' name='getType'/>
<vmethod name='getName'>
<pointer type-name='stl-string' name='str'/>
</vmethod>
<vmethod ret-type='int32_t'/>
<vmethod ret-type='bool' name='isCandidate'>
<int32_t name='item_id'/>
</vmethod>
<vmethod ret-type='bool'/>
<vmethod ret-type='int32_t' name='getUsedCount'/>
<vmethod ret-type='int32_t' name='getNumCandidates'/>
<vmethod/>
</virtual-methods>
</class-type>

<class-type type-name='build_req_choice_genst' inherits-from='build_req_choicest'>
Expand Down Expand Up @@ -123,6 +143,18 @@
<class-type type-name='interface_button' original-name='interface_buttonst'>
<int32_t name="hotkey_id"/>
<bool name="is_hidden"/>

<virtual-methods>
<vmethod name='getLabel'>
<pointer type-name='stl-string' name='str'/>
</vmethod>
<vmethod name='click'/>
<vmethod name='setColor'>
<bool name='selected'/>
</vmethod>
<vmethod/>
<vmethod is-destructor='true'/>
</virtual-methods>
</class-type>

<class-type type-name='interface_button_buildingst'
Expand Down

0 comments on commit c500259

Please sign in to comment.