cyphesis/rules/simulation/python/CyPy_Entity.h

62 lines
1.9 KiB
C
Raw Permalink Normal View History

/*
Copyright (C) 2018 Erik Ogenvik
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef CYPHESIS_CYPY_ENTITY_H
#define CYPHESIS_CYPY_ENTITY_H
#include "rules/simulation/Entity.h"
#include "rules/python/CyPy_LocatedEntity_impl.h"
class CyPy_Entity : public CyPy_LocatedEntityBase<Ref<Entity>, CyPy_Entity>
{
public:
CyPy_Entity(Py::PythonClassInstance* self, Py::Tuple& args, Py::Dict& kwds);
2018-07-31 13:37:19 +02:00
CyPy_Entity(Py::PythonClassInstance* self, Ref<Entity> value);
~CyPy_Entity() override;
static void init_type();
2018-07-31 13:37:19 +02:00
static Py::Object send_world(const Ref<Entity>& entity, const Py::Tuple& args);
static Py::Object start_task(const Ref<Entity>& entity, const Py::Tuple& args);
2018-08-11 23:26:04 +02:00
static Py::Object mod_property(const Ref<Entity>& entity, const Py::Tuple& args);
2018-11-03 16:43:33 +01:00
Py::Object getattro(const Py::String&) override;
int setattro(const Py::String& name, const Py::Object& attr) override;
protected:
Py::Object send_world(const Py::Tuple& args);
2018-07-31 13:37:19 +02:00
2018-07-24 21:16:50 +02:00
PYCXX_VARARGS_METHOD_DECL(CyPy_Entity, send_world);
2018-07-31 11:31:58 +02:00
Py::Object start_task(const Py::Tuple& args);
2018-07-31 13:37:19 +02:00
2018-07-31 11:31:58 +02:00
PYCXX_VARARGS_METHOD_DECL(CyPy_Entity, start_task);
2018-07-31 13:37:19 +02:00
2018-08-11 23:26:04 +02:00
Py::Object mod_property(const Py::Tuple& args);
PYCXX_VARARGS_METHOD_DECL(CyPy_Entity, mod_property);
};
#endif //CYPHESIS_CYPY_ENTITY_H