Mention more clearly how the data structures are defined in the Lua API.

develop
Alexander Gavrilov 2014-05-04 19:53:48 +04:00
parent 13584f08c5
commit cca8014630
2 changed files with 8 additions and 6 deletions

@ -455,9 +455,10 @@ It does not describe all of the utility functions
implemented by Lua files located in hack/lua/...</p> implemented by Lua files located in hack/lua/...</p>
<div class="section" id="df-data-structure-wrapper"> <div class="section" id="df-data-structure-wrapper">
<h1><a class="toc-backref" href="#id3">DF data structure wrapper</a></h1> <h1><a class="toc-backref" href="#id3">DF data structure wrapper</a></h1>
<p>DF structures described by the xml files in library/xml are exported <p>Data structures of the game are defined in XML files located in library/xml
to lua code as a tree of objects and functions under the <tt class="docutils literal">df</tt> global, (and online at <a class="reference external" href="http://github.com/DFHack/df-structures">http://github.com/DFHack/df-structures</a>), and automatically exported
which broadly maps to the <tt class="docutils literal">df</tt> namespace in C++.</p> to lua code as a tree of objects and functions under the <tt class="docutils literal">df</tt> global, which
also broadly maps to the <tt class="docutils literal">df</tt> namespace in the headers generated for C++.</p>
<p><strong>WARNING</strong>: The wrapper provides almost raw access to the memory <p><strong>WARNING</strong>: The wrapper provides almost raw access to the memory
of the game, so mistakes in manipulating objects are as likely to of the game, so mistakes in manipulating objects are as likely to
crash the game as equivalent plain C++ code would be. E.g. NULL crash the game as equivalent plain C++ code would be. E.g. NULL

@ -25,9 +25,10 @@ implemented by Lua files located in hack/lua/...
DF data structure wrapper DF data structure wrapper
========================= =========================
DF structures described by the xml files in library/xml are exported Data structures of the game are defined in XML files located in library/xml
to lua code as a tree of objects and functions under the ``df`` global, (and online at http://github.com/DFHack/df-structures), and automatically exported
which broadly maps to the ``df`` namespace in C++. to lua code as a tree of objects and functions under the ``df`` global, which
also broadly maps to the ``df`` namespace in the headers generated for C++.
**WARNING**: The wrapper provides almost raw access to the memory **WARNING**: The wrapper provides almost raw access to the memory
of the game, so mistakes in manipulating objects are as likely to of the game, so mistakes in manipulating objects are as likely to