// $Id$
//
-// SuperTux - A Jump'n Run
+// SuperTux
// Copyright (C) 2004 Ricardo Cruz <rick2@aeiou.pt>
+// Copyright (C) 2006 Matthias Braun <matze@braunis.de>
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
#include <sstream>
#include <stdexcept>
-#include "object_factory.h"
+#include "lisp/lisp.hpp"
+#include "lisp/parser.hpp"
+#include "object_factory.hpp"
+#include "math/vector.hpp"
Factories* object_factories = 0;
return i->second->create_object(reader);
}
+GameObject* create_object(const std::string& name, const Vector& pos)
+{
+ std::stringstream lisptext;
+ lisptext << "(" << name
+ << " (x " << pos.x << ")"
+ << " (y " << pos.y << "))";
+
+ lisp::Parser parser;
+ const lisp::Lisp* lisp = parser.parse(lisptext, "create_object");
+ GameObject* object = create_object(name, *lisp);
+
+ return object;
+}