cyphesis/rulesets/Python_API.h
Al Riddoch 0572ab631b * Renamed Operataion method names throughout so they no longer
all have the name Operation but are now called MoveOperation,
	  according to the type of operation they handle.

	* modules/DateTime.cpp, modules/DataTime.h: Filled in functionality,
	  allowing initialisation and updating from a time values in seconds.

	* modules/Location.h: Modified collision detection code so no
	  checking is done between two moving objects.

	* rulesets/BaseMind.h, rulesets/BaseMind.cpp, rulesets/Entity.h,
	  rulesets/Entity.cpp: Removed virtual getMap() method and replaced
	  with a fixed method in BaseMind only. Added time member veriable
	  to BaseMind so each mind keeps track of time by itself.

	* rulesets/Python_API.h, rulesets/Py_Mind.cpp, rulesets/Py_Mind.h:
	  Added specific python interface for mind objects, because if
	  increasing differences in the way this must be handled.

	* rulesets/Character.h, rulesets/Character.cpp: Added isAlive flag
	  which is cleared if the character is dead. If this flag is cleared,
	  operations are no longer sent to the mind.

	* rulesets/Movement.h, rulesets/Movement.cpp, rulesets/Pedestrian.h,
	  rulesets/Pedestrian.cpp: Cleaned up the code, made members more
	  distinctive, and make interface more general.

	* rulesets/Py_Thing.cpp: Removed features used to support mind.

	* rulesets/Py_WorldTime.cpp: Added support for comparison of
	  time with strings, to establish whether it matches descriptions
	  of time.

	* rulesets/Python_API.cpp: Modified creating of scripts so mind
	  scripts use a slightly different interface from entity scripts,
	  to support the fact that a mind handles its own timekeeping,
	  has a memory map, and has no access to the world.

	* server/WorldTime.cpp, server/WorldTime.h: Brought WorldTime into
	  the build. Used to track details of the time. Added support for
	  checking time descriptions such as "midday", "summer" against
	  DateTime.

Al Riddoch  <alriddoch@zepler.org>
2001-05-28 14:58:24 +00:00

107 lines
2 KiB
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,2001 Alistair Riddoch
#ifndef PYTHON_API_H
#define PYTHON_API_H
class Entity;
class Thing;
class BaseMind;
class MemMap;
class Location;
class WorldTime;
class WorldRouter;
#include <common/types.h>
#include <common/operations.h>
#include <physics/Vector3D.h>
#include <Python.h>
using Atlas::Message::Object;
typedef struct {
PyObject_HEAD
PyObject * Object_attr; // Attributes dictionary
Object * m_obj;
} AtlasObject;
typedef struct {
PyObject_HEAD
PyObject * Thing_attr; // Attributes dictionary
Entity * m_thing;
} ThingObject;
typedef struct {
PyObject_HEAD
PyObject * Mind_attr; // Attributes dictionary
BaseMind * m_mind;
} MindObject;
typedef struct {
PyObject_HEAD
MemMap * m_map;
} MapObject;
typedef struct {
PyObject_HEAD
Location * location;
int own;
} LocationObject;
typedef struct {
PyObject_HEAD
Vector3D coords;
} Vector3DObject;
typedef struct {
PyObject_HEAD
WorldTime * time;
} WorldTimeObject;
typedef struct {
PyObject_HEAD
WorldRouter * world;
} WorldObject;
typedef struct {
PyObject_HEAD
PyObject * Operation_attr;
RootOperation * operation;
int own;
Entity * from;
Entity * to;
} RootOperationObject;
typedef struct {
PyObject_HEAD
oplist * ops;
} OplistObject;
typedef struct {
PyObject_HEAD
} FunctionObject;
typedef struct {
PyObject_HEAD
RootOperation * operation;
} OptimeObject;
#include "Py_Object.h"
#include "Py_Thing.h"
#include "Py_Mind.h"
#include "Py_Map.h"
#include "Py_Location.h"
#include "Py_Vector3D.h"
#include "Py_WorldTime.h"
#include "Py_World.h"
#include "Py_Operation.h"
#include "Py_Oplist.h"
#include "Py_Optime.h"
void Create_PyThing(Thing * thing, const string& package, const string& type);
void Create_PyMind(BaseMind * mind, const string& package, const string& type);
#endif // PYTHON_API_H