5 #include "spawn_point.hpp"
6 #include "lisp/lisp.hpp"
7 #include "lisp/list_iterator.hpp"
9 SpawnPoint::SpawnPoint()
12 SpawnPoint::SpawnPoint(const SpawnPoint& other)
13 : name(other.name), pos(other.pos)
16 SpawnPoint::SpawnPoint(const lisp::Lisp* slisp)
20 lisp::ListIterator iter(slisp);
22 const std::string& token = iter.item();
24 iter.value()->get(name);
25 } else if(token == "x") {
26 iter.value()->get(pos.x);
27 } else if(token == "y") {
28 iter.value()->get(pos.y);
30 std::cerr << "Warning: unknown token '" << token
31 << "' in SpawnPoint\n";
36 throw std::runtime_error("No name specified for spawnpoint");
37 if(pos.x < 0 || pos.y < 0)
38 throw std::runtime_error("Invalid coordinates for spawnpoint");