mirror of
https://github.com/worldforge/cyphesis
synced 2026-08-13 12:26:04 -04:00
* Substantial re-work of object model. Moved many attributes out of BaseEntity class. Changed WoldRouter so it now handles objects in terms of Entity, rather than BaseEntity. * Code cleanups, including removing reduntant includes, and getting rid of C style comments. * Fixed the way attributes are handled in Set operations and when merging from an Atlas::Message::Object. This fixed problem with setting gender of characters. * rulesets/Pedestrian.*, rulesets/Movement.*: Re-named Movement variables to make them clearer. Added in separate handling for collisions from moving to target position. Modified collision handling so objects can slide next to each other. * rulesets/Thing.cpp, rulesets/Character.cpp: Cleaned up and rationalised movement code. Much shorter, faster and more compact than before. * Made better use of iterators throughout, eliminating unnecessary lookups, and copying of data. * Moved all virtual functions out of header files, making less work for the linker. * Made more use of const references to avoid the need to copy data before being able to inspect it. Al Riddoch <alriddoch@zepler.org>
28 lines
846 B
C
28 lines
846 B
C
// This file may be redistributed and modified only under the terms of
|
|
// the GNU General Public License (See COPYING for details).
|
|
// Copyright (C) 2000 Alistair Riddoch
|
|
|
|
#include <stdio.h>
|
|
#include <unistd.h>
|
|
|
|
extern PyTypeObject Object_Type;
|
|
|
|
#define PyAtlasObject_Check(_o) ((PyTypeObject*)PyObject_Type((PyObject*)_o)==&Object_Type)
|
|
|
|
//
|
|
// Object creation function.
|
|
//
|
|
|
|
AtlasObject * newAtlasObject(PyObject *arg);
|
|
|
|
//
|
|
// Utility functions to munge between Object related types and python types
|
|
//
|
|
|
|
// PyObject * MapType_asPyObject(const Object::MapType & map);
|
|
// PyObject * ListType_asPyObject(const Object::ListType & list);
|
|
PyObject * Object_asPyObject(const Object & obj);
|
|
// Object::ListType PyListObject_asListType(PyObject * list);
|
|
// Object::MapType PyDictObject_asMapType(PyObject * dict);
|
|
Object PyObject_asObject(PyObject * o);
|
|
|