[wpdev-commits] wolfpack/python pyspawnregion.cpp,1.1,1.2
Brought to you by:
rip,
thiagocorrea
From: Correa <thi...@us...> - 2004-07-29 19:36:39
|
Update of /cvsroot/wpdev/wolfpack/python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8973/python Modified Files: pyspawnregion.cpp Log Message: doc update and minor improvement Index: pyspawnregion.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/python/pyspawnregion.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pyspawnregion.cpp 27 Jul 2004 04:15:20 -0000 1.1 --- pyspawnregion.cpp 29 Jul 2004 19:36:22 -0000 1.2 *************** *** 32,37 **** /* ! \object region ! \description This object type represents a region within the ultima online world. */ typedef struct --- 32,37 ---- /* ! \object spawnregion ! \description This object type represents a spawnregion within the Ultima Online world. */ typedef struct *************** *** 46,50 **** /*! ! The typedef for Wolfpack Python items */ static PyTypeObject wpSpawnRegionType = --- 46,50 ---- /*! ! The typedef for Wolfpack Python items */ static PyTypeObject wpSpawnRegionType = *************** *** 64,82 **** /* \method spawnregion.removeitem - \description \param serial */ ! static PyObject* wpSpawnRegion_removeitem( wpSpawnRegion* self, PyObject* args ) { SERIAL serial; ! if ( !PyArg_ParseTuple( args, "i:spawnregion.removeitem(serial)", &serial ) ) { return 0; } ! QPtrList<cUObject> items = self->pRegion->spawnedItems(); // Copy ! cUObject *object; ! for (object = items.first(); object; object = items.next()) { if ( object->serial() == serial ) --- 64,91 ---- /* \method spawnregion.removeitem \param serial + \description Remove the given object from a spawnregion, freeing the slot for a new item + to be spawned. */ ! static PyObject* wpSpawnRegion_remove( wpSpawnRegion* self, PyObject* args ) { SERIAL serial; ! if ( !PyArg_ParseTuple( args, "i:spawnregion.remove(serial)", &serial ) ) { return 0; } ! QPtrList<cUObject> objects; ! if ( isItemSerial(serial) ) ! { ! objects = self->pRegion->spawnedItems(); // Copy ! } ! else ! { ! objects = self->pRegion->spawnedNpcs(); // Copy ! } ! cUObject *object; ! for (object = objects.first(); object; object = objects.next()) { if ( object->serial() == serial ) *************** *** 87,117 **** /* ! \method spawnregion.removenpc ! \description ! \param serial */ ! static PyObject* wpSpawnRegion_removenpc( wpSpawnRegion* self, PyObject* args ) { ! SERIAL serial; ! if ( !PyArg_ParseTuple( args, "i:spawnregion.removenpc(serial)", &serial ) ) { return 0; } - - QPtrList<cUObject> items = self->pRegion->spawnedNpcs(); // Copy - cUObject *object; - - for (object = items.first(); object; object = items.next()) - { - if ( object->serial() == serial ) - object->remove(); - } - Py_RETURN_NONE; } static PyMethodDef wpSpawnRegionMethods[] = { ! { "removeitem", ( getattrofunc ) wpSpawnRegion_removeitem, METH_VARARGS, NULL }, ! { "removenpc", ( getattrofunc ) wpSpawnRegion_removenpc, METH_VARARGS, NULL }, { NULL, NULL, 0, NULL } }; --- 96,117 ---- /* ! \method spawnregion.spawn ! \param baseids [Optional] is a list of BaseIDs to be spawned from ! \description Remove the given object from a spawnregion, freeing the slot for a new item ! to be spawned. */ ! static PyObject* wpSpawnRegion_spawn( wpSpawnRegion* self, PyObject* args ) { ! PyObject* baseids = 0; ! if ( !PyArg_ParseTuple( args, "|O!:spawnregion.spawn([baseids])", &PyList_Type, &baseids ) ) { return 0; } } static PyMethodDef wpSpawnRegionMethods[] = { ! { "remove", ( getattrofunc ) wpSpawnRegion_remove, METH_VARARGS, NULL }, ! { "spawn", ( getattrofunc ) wpSpawnRegion_spawn, METH_VARARGS, NULL }, { NULL, NULL, 0, NULL } }; *************** *** 141,154 **** } /* ! \rproperty spawnregion.curnpcspawn */ ! else if ( !strcmp( name, "curnpcspawn" ) ) { return PyInt_FromLong( self->pRegion->npcs() ); } /* ! \rproperty spawnregion.curitemspawn */ ! else if ( !strcmp( name, "curitemspawn" ) ) { return PyInt_FromLong( self->pRegion->items() ); --- 141,154 ---- } /* ! \rproperty spawnregion.npcspawncount */ ! else if ( !strcmp( name, "npcspawncount" ) ) { return PyInt_FromLong( self->pRegion->npcs() ); } /* ! \rproperty spawnregion.itemspawncount */ ! else if ( !strcmp( name, "itemspawncount" ) ) { return PyInt_FromLong( self->pRegion->items() ); *************** *** 194,198 **** } /* ! \rproperty spawnregion.spawneditems */ else if ( !strcmp( name, "spawnednpcs" ) ) --- 194,198 ---- } /* ! \rproperty spawnregion.spawnednpcs */ else if ( !strcmp( name, "spawnednpcs" ) ) |