Skip to content

Commit d78ae86

Browse files
authored
Merge pull request #905 from ab9rf/template-coord
switch `coord` and `coord2d` to use templates
2 parents ba54561 + f9f9a78 commit d78ae86

1 file changed

Lines changed: 6 additions & 11 deletions

File tree

df.dfhack.xml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -576,15 +576,13 @@
576576
</enum-type>
577577

578578
<struct-type type-name='coord2d' custom-methods='true' comment='not a real structure'>
579+
<!-- these are not actually used by codegen and are here only for reference -->
579580
<int16_t name='x' init-value='-30000'/>
580581
<int16_t name='y' init-value='-30000'/>
581582

582-
<custom-methods>
583-
<cmethod name='isValid'/>
584-
<cmethod name='clear'/>
585-
</custom-methods>
586-
583+
<extra-include filename="CoordTemplate.h"/>
587584
<code-helper name='describe'>(fmt "(~A,~A)" $.x $.y)</code-helper>
585+
<codegen-override template="DFHack::Coord2d" using="int16_t" no-constructor="true" no-identity="true"/>
588586
</struct-type>
589587

590588
<struct-type type-name='coord2d_path' custom-methods='true' comment='not a real structure'>
@@ -605,17 +603,14 @@
605603
</struct-type>
606604

607605
<struct-type type-name='coord' custom-methods='true' comment='not a real structure'>
606+
<!-- these are not actually used by codegen and are here only for reference -->
608607
<int16_t name='x' init-value='-30000'/>
609608
<int16_t name='y' init-value='-30000'/>
610609
<int16_t name='z' init-value='-30000'/>
611610

612-
<extra-include type-name='coord2d'/>
613-
<custom-methods>
614-
<cmethod name='isValid'/>
615-
<cmethod name='clear'/>
616-
</custom-methods>
617-
611+
<extra-include filename="CoordTemplate.h"/>
618612
<code-helper name='describe'>(fmt "(~A,~A,~A)" $.x $.y $.z)</code-helper>
613+
<codegen-override template="DFHack::Coord3d" using="int16_t" no-constructor="true" no-identity="true"/>
619614
</struct-type>
620615

621616
<struct-type type-name='coord_path' custom-methods='true' comment='not a real structure'>

0 commit comments

Comments
 (0)