From 8eacdbe7f9491b8be354accd8accdac29903d9cc Mon Sep 17 00:00:00 2001 From: doomchild Date: Fri, 23 Apr 2010 14:32:24 -0500 Subject: [PATCH] added new namedtuples --- dfhack/python/pydftypes.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/dfhack/python/pydftypes.py b/dfhack/python/pydftypes.py index 4e77a2b1b..5ff79d7ea 100644 --- a/dfhack/python/pydftypes.py +++ b/dfhack/python/pydftypes.py @@ -1,16 +1,31 @@ from collections import namedtuple +Position2D = namedtuple("Position2D", "x, y") +Position3D = namedtuple("Position3D", "x, y, z") +Rectangle = namedtuple("Rectangle", "x1, y1, x2, y2") Note = namedtuple("Note", "symbol, foreground, background, name, position") Construction = namedtuple("Construction", "position, form, unk_8, mat_type, mat_idx, unk3, unk4, unk5, unk6, origin") Vein = namedtuple("Vein", "vtable, type, flags, address, assignment") FrozenLiquidVein = namedtuple("FrozenLiquidVein", "vtable, address, tiles") SpatterVein = namedtuple("SpatterVein", "vtable, address, mat1, unk1, mat2, mat3, intensity") +Settlement = namedtuple("Settlement", "origin, name, world_pos, local_pos") +Attribute = namedtuple("Attribute", "level, field_4, field_8, field_C, leveldiff, field_14, field_18"); +Skill = namedtuple("Skill", "id, experience, rating") +Tree = namedtuple("Tree", "type, material, position, address") +CreatureCaste = namedtuple("CreatureCaste", "rawname, singular, plural, adjective") +Matgloss = namedtuple("Matgloss", "id, fore, back, bright, name") +DescriptorColor = namedtuple("DescriptorColor", "id, r, v, b, name") +CreatureTypeEx = namedtuple("CreatureTypeEx", "rawname, castes, tile_character, tilecolor") +TileColor = namedtuple("TileColor", "fore, back, bright") class Name(object): __slots__ = ["first_name", "nickname", "language", "has_name", "words", "parts_of_speech"] class Soul(object): - pass + def __init__(self, *args, **kwds): + if kwds: + for k, v in kwds.iteritems(): + self.__dict__[k] = v class MapBlock40d(object): pass \ No newline at end of file