5 #include "spawn_point.hpp"
6 #include "lisp/lisp.hpp"
7 #include "lisp/list_iterator.hpp"
10 SpawnPoint::SpawnPoint()
13 SpawnPoint::SpawnPoint(const SpawnPoint& other)
14 : name(other.name), pos(other.pos)
17 SpawnPoint::SpawnPoint(const lisp::Lisp* slisp)
21 lisp::ListIterator iter(slisp);
23 const std::string& token = iter.item();
25 iter.value()->get(name);
26 } else if(token == "x") {
27 iter.value()->get(pos.x);
28 } else if(token == "y") {
29 iter.value()->get(pos.y);
31 msg_warning("unknown token '" << token
32 << "' in SpawnPoint");
37 throw std::runtime_error("No name specified for spawnpoint");
38 if(pos.x < 0 || pos.y < 0)
39 throw std::runtime_error("Invalid coordinates for spawnpoint");