1 /* 2 Copyright (C) 2010-2014 Kristian Duske 3 4 This file is part of TrenchBroom. 5 6 TrenchBroom is free software: you can redistribute it and/or modify 7 it under the terms of the GNU General Public License as published by 8 the Free Software Foundation, either version 3 of the License, or 9 (at your option) any later version. 10 11 TrenchBroom is distributed in the hope that it will be useful, 12 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 GNU General Public License for more details. 15 16 You should have received a copy of the GNU General Public License 17 along with TrenchBroom. If not, see <http://www.gnu.org/licenses/>. 18 */ 19 20 #include "MapFormat.h" 21 22 namespace TrenchBroom { 23 namespace Model { mapFormat(const String & formatName)24 MapFormat::Type mapFormat(const String& formatName) { 25 if (formatName == "Standard") 26 return MapFormat::Standard; 27 if (formatName == "Quake2") 28 return MapFormat::Quake2; 29 if (formatName == "Valve") 30 return MapFormat::Valve; 31 if (formatName == "Hexen2") 32 return MapFormat::Hexen2; 33 return MapFormat::Unknown; 34 } 35 formatName(const MapFormat::Type format)36 String formatName(const MapFormat::Type format) { 37 if (format == MapFormat::Standard) 38 return "Standard"; 39 if (format == MapFormat::Quake2) 40 return "Quake2"; 41 if (format == MapFormat::Valve) 42 return "Valve"; 43 if (format == MapFormat::Hexen2) 44 return "Hexen2"; 45 return "Unknown"; 46 } 47 } 48 } 49