summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/clua.cc
diff options
context:
space:
mode:
authorJude Brown <bookofjude@users.sourceforge.net>2009-11-19 10:59:18 +1000
committerJude Brown <bookofjude@users.sourceforge.net>2009-11-19 10:59:18 +1000
commitf95ed5801c4bd054caee02425025eef4babeedae (patch)
tree855a0c0544fa8f064e44493dfeaa022ea9d3a9e7 /crawl-ref/source/clua.cc
parentd608f8e4951b1f61f1f267315763124920abb900 (diff)
downloadcrawl-ref-f95ed5801c4bd054caee02425025eef4babeedae.tar.gz
crawl-ref-f95ed5801c4bd054caee02425025eef4babeedae.zip
dat/clua/iter.lua: iterators for Lua.
Currently only includes: rectangle_iterator: iterates points between two corners. los_iterator: iterates over currently visible points in LOS. adjacent_iterator: iterates over adjacent points to the center. Most iterators accept a "filter" parameter that is a function which should either return true if the point is acceptable for the iteration, or false if it is not. los_iterator is currently restricted to player LOS rather than actor or monster LOS, but could be expanded at a later date. All of the iterators seem to work as intended: hopefully I haven't made too many mistakes with them.
Diffstat (limited to 'crawl-ref/source/clua.cc')
-rw-r--r--crawl-ref/source/clua.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/crawl-ref/source/clua.cc b/crawl-ref/source/clua.cc
index 4f25a2d362..d750fc9f09 100644
--- a/crawl-ref/source/clua.cc
+++ b/crawl-ref/source/clua.cc
@@ -636,6 +636,7 @@ void CLua::init_lua()
lua_register(_state, "require", _clua_require);
execfile("clua/util.lua", true, true);
+ execfile("clua/iter.lua", true, true);
execfile("clua/init.lua", true, true);
if (managed_vm)