#include <spawn_point.hpp>
Public Member Functions | |
SpawnPoint () | |
SpawnPoint (const SpawnPoint &other) | |
SpawnPoint (const Reader &lisp) | |
Public Attributes | |
std::string | name |
Vector | pos |
Definition at line 23 of file spawn_point.hpp.
SpawnPoint::SpawnPoint | ( | ) |
SpawnPoint::SpawnPoint | ( | const SpawnPoint & | other | ) |
SpawnPoint::SpawnPoint | ( | const Reader & | lisp | ) |
Definition at line 33 of file spawn_point.cpp.
References lisp::Lisp::get(), lisp::ListIterator::item(), log_warning, name, lisp::ListIterator::next(), pos, lisp::ListIterator::value(), Vector::x, and Vector::y.
00033 : 00034 name(), 00035 pos() 00036 { 00037 pos.x = -1; 00038 pos.y = -1; 00039 lisp::ListIterator iter(&slisp); 00040 while(iter.next()) { 00041 const std::string& token = iter.item(); 00042 if(token == "name") { 00043 iter.value()->get(name); 00044 } else if(token == "x") { 00045 iter.value()->get(pos.x); 00046 } else if(token == "y") { 00047 iter.value()->get(pos.y); 00048 } else { 00049 log_warning << "unknown token '" << token << "' in SpawnPoint" << std::endl; 00050 } 00051 } 00052 00053 if(name == "") 00054 throw std::runtime_error("No name specified for spawnpoint"); 00055 if(pos.x < 0 || pos.y < 0) 00056 throw std::runtime_error("Invalid coordinates for spawnpoint"); 00057 }
std::string SpawnPoint::name |
Definition at line 30 of file spawn_point.hpp.
Referenced by Sector::parse_old_format(), and SpawnPoint().
Definition at line 31 of file spawn_point.hpp.
Referenced by Sector::activate(), Sector::parse_old_format(), SpawnPoint(), and FlipLevelTransformer::transform_spawnpoint().