void SnapshotCommand::restoreSnapshots(const Model::BrushList& brushes) {
     assert(m_brushes.size() == brushes.size());
     
     for (unsigned int i = 0; i < brushes.size(); i++) {
         Model::Brush& brush = *brushes[i];
         BrushSnapshot& snapshot = *m_brushes[brush.uniqueId()];
         snapshot.restore(brush);
     }
 }
Пример #2
0
 bool MapParser::parseBrushes(const BBox& worldBounds, Model::BrushList& brushes) {
     size_t oldSize = brushes.size();
     try {
         Model::Brush* brush = NULL;
         while ((brush = parseBrush(worldBounds, NULL)) != NULL)
             brushes.push_back(brush);
         return !brushes.empty();
     } catch (MapParserException e) {
         Utility::deleteAll(brushes, oldSize);
         m_tokenizer.reset();
         return false;
     }
 }
 void SnapshotCommand::makeSnapshots(const Model::BrushList& brushes) {
     for (unsigned int i = 0; i < brushes.size(); i++) {
         Model::Brush& brush = *brushes[i];
         m_brushes[brush.uniqueId()] = new BrushSnapshot(brush);
     }
 }