void GameStart::over() { //make adventurer WorldManager &wm = WorldManager::getInstance(); Adventurer *a = new Adventurer; wm.addObject(a); //read in curses CurseList::getInstance().readCurses("curse_list.txt"); //make room map GameMap* gm = new GameMap(); int status = gm->generateMap(); if(status < 0) { LogManager::getInstance().WRITELOG("generateMap failed."); } else { gm->getCurrentRoom()->makeActive(); //make messager new Messager; //new message EventMessage em("You enter the vault."); wm.broadcastEvent(&em); } WorldManager::getInstance().markForDelete(this); }
void DataMap::load_map(ThreeDManager& threeDManager) { GameMap myGameMap; myGameMap.generateMap((unsigned int)this->width - 2, (unsigned int)this->height - 2); for (int y = 0; y < (int)this->height; y++) { char *info = new char[32]; if (y == 0 || y == (int)this->height - 1) { for (int i = 0; i < (int)this->width; i++) info[i] = 'w'; } else { for (int x = 0; x < (int)this->width; x++) { if (x == 0 || x == (int)this->width - 1) info[x] = 'w'; else { if (myGameMap.getCase(x - 1, y - 1) == MAP_CASE_EMPTY) info[x] = ' '; else if (myGameMap.getCase(x - 1, y - 1) == MAP_CASE_WALL) info[x] = 'w'; else if (myGameMap.getCase(x - 1, y - 1) == MAP_CASE_CRATE) info[x] = 'g'; } } } mapinfo[y].assign(info); delete []info; } this->load3DObjects(threeDManager); }