added flag and composite imports

develop
doomchild 2010-04-15 10:04:10 -05:00
parent 95d364dfca
commit 0af57ac972
1 changed files with 17 additions and 6 deletions

@ -27,24 +27,35 @@ distribution.
#include "Python.h" #include "Python.h"
static PyObject* TypesModule = NULL; static PyObject* FlagsModule = NULL;
static PyObject* CreatureFlags1_type = NULL; static PyObject* CreatureFlags1_type = NULL;
static PyObject* CreatureFlags2_type = NULL; static PyObject* CreatureFlags2_type = NULL;
static PyObject* DesignationFlags_type = NULL; static PyObject* DesignationFlags_type = NULL;
static PyObject* OccupancyFlags_type = NULL; static PyObject* OccupancyFlags_type = NULL;
static PyObject* ItemFlags_type = NULL; static PyObject* ItemFlags_type = NULL;
static PyObject* TypesModule = NULL;
static PyObject* Note_type = NULL;
static PyObject* Construction_type = NULL;
static PyObject* Name_type = NULL;
static void DoImports() static void DoImports()
{ {
if(TypesModule == NULL) if(TypesModule == NULL)
{ {
FlagsModule = PyImport_ImportModule("pydfhackflags");
CreatureFlags1_type = PyObject_GetAttrString(FlagsModule, "CreatureFlags1");
CreatureFlags2_type = PyObject_GetAttrString(FlagsModule, "CreatureFlags2");
DesignationFlags_type = PyObject_GetAttrString(FlagsModule, "DesignationFlags");
OccupancyFlags_type = PyObject_GetAttrString(FlagsModule, "OccupancyFlags");
ItemFlags_type = PyObject_GetAttrString(FlagsModule, "ItemFlags");
TypesModule = PyImport_ImportModule("pydftypes"); TypesModule = PyImport_ImportModule("pydftypes");
CreatureFlags1_type = PyObject_GetAttrString(TypesModule, "CreatureFlags1"); Note_type = PyObject_GetAttrString(TypesModule, "Note");
CreatureFlags2_type = PyObject_GetAttrString(TypesModule, "CreatureFlags2"); Construction_type = PyObject_GetAttrString(TypesModule, "Construction");
DesignationFlags_type = PyObject_GetAttrString(TypesModule, "DesignationFlags"); Name_type = PyObject_GetAttrString(TypesModule, "Name");
OccupancyFlags_type = PyObject_GetAttrString(TypesModule, "OccupancyFlags");
ItemFlags_type = PyObject_GetAttrString(TypesModule, "ItemFlags");
} }
} }