- for(lisp_object_t* cur = level->get_lisp(); !lisp_nil_p(cur);
- cur = lisp_cdr(cur)) {
- std::string token = lisp_symbol(lisp_car(lisp_car(cur)));
- lisp_object_t* data = lisp_car(lisp_cdr(lisp_car(cur)));
- LispReader reader(lisp_cdr(lisp_car(cur)));
-
- if(token == "version") {
- if(lisp_integer(data) > 2) {
- std::cerr << "Warning: level format newer than application.\n";
- }
- } else if(token == "name") {
- name = lisp_string(data);
- } else if(token == "author") {
- author = lisp_string(data);
- } else if(token == "time") {
- timelimit = lisp_integer(data);
- } else if(token == "sector") {
- Sector* sector = new Sector;
- sector->parse(reader);
- add_sector(sector);
- } else if(token == "end-sequence-animation") {
- std::string endsequencename = lisp_string(data);
- if(endsequencename == "fireworks") {
- end_sequence_type = FIREWORKS_ENDSEQ_ANIM;
+ lisp::ListIterator iter(level);
+ while(iter.next()) {
+ const std::string& token = iter.item();
+ if(token == "version") {
+ iter.value()->get(version);
+ if(version > 2) {
+ log_warning << "level format newer than application" << std::endl;
+ }
+ } else if(token == "name") {
+ iter.value()->get(name);
+ } else if(token == "author") {
+ iter.value()->get(author);
+ } else if(token == "on-menukey-script") {
+ iter.value()->get(on_menukey_script);
+ } else if(token == "sector") {
+ Sector* sector = new Sector(this);
+ sector->parse(*(iter.lisp()));
+ add_sector(sector);