From 78c5ef5c71317fa90a9615b0c539e67d68c24aa8 Mon Sep 17 00:00:00 2001 From: doomchild Date: Fri, 13 Aug 2010 12:31:53 -0500 Subject: [PATCH] added vein readers --- library/python/pydfhack/maps.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/library/python/pydfhack/maps.py b/library/python/pydfhack/maps.py index c889719e8..f92b75598 100644 --- a/library/python/pydfhack/maps.py +++ b/library/python/pydfhack/maps.py @@ -1,5 +1,5 @@ from ctypes import * -from pydftypes import * +from dftypes import * from util import _uintify, uint_ptr _MAX_DIM = 0x300 @@ -15,6 +15,9 @@ libdfhack.Maps_WriteTemperatures.argtypes = [ c_void_p, c_uint, c_uint, c_uint, libdfhack.Maps_ReadOccupancy.argtypes = [ c_void_p, c_uint, c_uint, c_uint, POINTER(Occupancies40d) ] libdfhack.Maps_WriteOccupancy.argtypes = [ c_void_p, c_uint, c_uint, c_uint, POINTER(Occupancies40d) ] libdfhack.Maps_ReadRegionOffsets.argtypes = [ c_void_p, c_uint, c_uint, c_uint, POINTER(BiomeIndices40d) ] +libdfhack.Maps_ReadStandardVeins.argtypes = [ c_void_p, c_uint, c_uint, c_uint ] +libdfhack.Maps_ReadFrozenVeins.argtypes = [ c_void_p, c_uint, c_uint, c_uint ] +libdfhack.Maps_ReadSpatterVeins.argtypes = [ c_void_p, c_uint, c_uint, c_uint ] class Maps(object): def __init__(self, ptr): @@ -151,6 +154,21 @@ class Maps(object): return bi else: return None + + def read_veins(self, x, y, z): + ux, uy, uz = _uintify(x, y, z) + + return libdfhack.Maps_ReadStandardVeins(self._map_ptr, ux, uy, uz) + + def read_frozen_veins(self, x, y, z): + ux, uy, uz = _uintify(x, y, z) + + return libdfhack.Maps_ReadFrozenVeins(self._map_ptr, ux, uy, uz) + + def read_spatter_veins(self, x, y, z): + ux, uy, uz = _uintify(x, y, z) + + return libdfhack.Maps_ReadSpatterVeins(self._map_ptr, ux, uy, uz) @property def size(self):