Skip to content

Commit

Permalink
Expose all currently-possible custom methods to lua
Browse files Browse the repository at this point in the history
Excludes polymorphic methods and methods that take references
  • Loading branch information
lethosor committed May 29, 2016
1 parent 40aa964 commit 9d3453c
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
3 changes: 3 additions & 0 deletions df.graphics.xml
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@
</compound>

<uint32_t name='clock'/>
<custom-methods>
<cmethod name='zoom_display'/>
</custom-methods>
</struct-type>
</data-definition>

Expand Down
33 changes: 33 additions & 0 deletions df.map.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,22 @@
<int16_t name='x' init-value='-30000'/>
<int16_t name='y' init-value='-30000'/>

<custom-methods>
<cmethod name='isValid'/>
<cmethod name='clear'/>
</custom-methods>

<code-helper name='describe'>(fmt "(~A,~A)" $.x $.y)</code-helper>
</struct-type>

<struct-type type-name='coord2d_path' custom-methods='true'>
<stl-vector type-name='int16_t' name='x'/>
<stl-vector type-name='int16_t' name='y'/>

<custom-methods>
<cmethod name='size'/>
<cmethod name='erase'/>
</custom-methods>
<code-helper name='describe'>
(fmt "[~A]" $.x.count)
(loop for i from 0 below (min $.x.count 3)
Expand All @@ -23,6 +32,11 @@
<int16_t name='y' init-value='-30000'/>
<int16_t name='z' init-value='-30000'/>

<custom-methods>
<cmethod name='isValid'/>
<cmethod name='clear'/>
</custom-methods>

<code-helper name='describe'>(fmt "(~A,~A,~A)" $.x $.y $.z)</code-helper>
</struct-type>

Expand All @@ -31,6 +45,13 @@
<stl-vector type-name='int16_t' name='y'/>
<stl-vector type-name='int16_t' name='z'/>

<custom-methods>
<cmethod name='empty'/>
<cmethod name='size'/>
<cmethod name='clear'/>
<cmethod name='erase'/>
</custom-methods>

<code-helper name='describe'>
(fmt "[~A]" $.x.count)
(loop for i from 0 below (min $.x.count 3)
Expand Down Expand Up @@ -180,6 +201,11 @@
<static-array name='bits' count='16'>
<uint16_t/>
</static-array>
<custom-methods>
<cmethod name='clear'/>
<cmethod name='set_all'/>
<cmethod name='has_assignments'/>
</custom-methods>
</struct-type>

<struct-type type-name='block_burrow' custom-methods='true'>
Expand All @@ -188,6 +214,10 @@
<compound name='tile_bitmask' type-name='tile_bitmask'/>

<pointer name="link" type-name='block_burrow_link'/>

<custom-methods>
<cmethod name='has_assignments'/>
</custom-methods>
</struct-type>

<struct-type type-name='block_burrow_link'>
Expand Down Expand Up @@ -420,6 +450,9 @@
<flag-bit name='cluster_small'/>
<flag-bit name='cluster_one'/>
</bitfield>
<custom-methods>
<cmethod name='has_assignments'/>
</custom-methods>
</class-type>

<class-type type-name='block_square_event_frozen_liquidst' inherits-from='block_square_event'>
Expand Down
7 changes: 7 additions & 0 deletions df.materials.xml
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,10 @@

<stl-string name='powder_dye_str' comment='temporary'/>
<static-array name='state_color_str' type-name='stl-string' count='6' index-enum='matter_state'/>
<custom-methods>
<cmethod name='isGem'/>
<cmethod name='isStone'/>
</custom-methods>
</struct-type>

<struct-type type-name='material_vec_ref'>
Expand Down Expand Up @@ -439,6 +443,9 @@
<int32_t name='unk2'/>

<compound name='material' type-name='material'/>
<custom-methods>
<cmethod name='isOre'/>
</custom-methods>
</struct-type>

<enum-type type-name='organic_mat_category'>
Expand Down

0 comments on commit 9d3453c

Please sign in to comment.