int main() { init_python_api(); Py_InitModule("testmod", no_methods); run_python_string("import server"); run_python_string("import testmod"); run_python_string("from atlas import Operation"); run_python_string("class settlerMind(server.Thing):\n" " def look_operation(self, op): pass\n" " def delete_operation(self, op):\n" " return Operation('sight') + Operation('move')\n" " def test_hook(self, ent): pass\n" ); run_python_string("testmod.settlerMind=settlerMind"); TypeNode * tn = new TypeNode(); tn->name() = etype; MindFactory * mf = MindFactory::instance(); mf->addMindType(etype, "testmod"); mf->newMind("1", 1, tn); tn->name() = etype; mf->newMind("2", 2, tn); shutdown_python_api(); return 0; }
int main() { MindFactory * mf = new MindFactory; mf->newMind("1", 1); mf->newMind("2", 2); return 0; }
int main() { TypeNode * tn = new TypeNode(); tn->name() = etype; MindFactory * mf = MindFactory::instance(); mf->addMindType(etype, "testmod"); mf->newMind("1", 1, tn); tn->name() = etype; mf->newMind("2", 2, tn); return 0; }