void nrn_finitialize(int setv, double v) { int i; NrnThread* _nt; t = 0.; dt2thread(-1.); nrn_thread_table_check(); clear_event_queue(); nrn_spike_exchange_init(); #if VECTORIZE nrn_play_init(); /* Vector.play */ ///Play events should be executed before initializing events for (i=0; i < nrn_nthread; ++i) { nrn_deliver_events(nrn_threads + i); /* The play events at t=0 */ } if (setv) { for (_nt = nrn_threads; _nt < nrn_threads + nrn_nthread; ++_nt) { for (i=0; i < _nt->end; ++i) { VEC_V(i) = v; } } } for (i=0; i < nrn_nthread; ++i) { nrn_ba(nrn_threads + i, BEFORE_INITIAL); } /* the INITIAL blocks are ordered so that mechanisms that write concentrations are after ions and before mechanisms that read concentrations. */ /* the memblist list in NrnThread is already so ordered */ for (i=0; i < nrn_nthread; ++i) { NrnThread* nt = nrn_threads + i; NrnThreadMembList* tml; for (tml = nt->tml; tml; tml = tml->next) { mod_f_t s = memb_func[tml->index].initialize; if (s) { (*s)(nt, tml->ml, tml->index); } } } #endif init_net_events(); for (i = 0; i < nrn_nthread; ++i) { nrn_ba(nrn_threads + i, AFTER_INITIAL); } for (i=0; i < nrn_nthread; ++i) { nrn_deliver_events(nrn_threads + i); /* The INITIAL sent events at t=0 */ } for (i=0; i < nrn_nthread; ++i) { setup_tree_matrix_minimal(nrn_threads + i); } for (i=0; i < nrn_nthread; ++i) { nrn_deliver_events(nrn_threads + i); /* The record events at t=0 */ } #if NRNMPI nrn_spike_exchange(nrn_threads); #endif }
Dungeon::~Dungeon() { for (Floor *f : s_instance->floors) { delete f; } for (Character *c : graveyard) { delete c; } clear_event_queue(); }
bool Dungeon::change_floor_up() { if (active_floor == 0) { IO_handler::queue_message("The way up is blocked, you are trapped in the dungeon"); return true; } clear_event_queue(); s_instance->floors.at(active_floor)->reset_current_vision(); active_floor--; queue_monster_turns(); PC::instance()->update_vision(floors.at(active_floor)); return true; }
bool Dungeon::change_floor_down() { clear_event_queue(); if (floors.size() <= active_floor+1) { Floor *f = new Floor(); f->spawn_pc(PC::instance()); f->place_at_stairs(true); s_instance->floors.push_back(f); s_instance->active_floor++; s_instance->generate_monsters(); s_instance->generate_objects(); s_instance->active_floor--; } s_instance->floors.at(active_floor)->reset_current_vision(); s_instance->active_floor++; queue_monster_turns(); PC::instance()->update_vision(floors.at(active_floor)); return true; }
static void debug_set_editmode() { edit_setup(); keymode = KEY_EDIT; clear_event_queue(); }