1 /* 2 * Copyright (C) 2014-2018 Christopho, Solarus - http://www.solarus-games.org 3 * 4 * Solarus Quest Editor is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation, either version 3 of the License, or 7 * (at your option) any later version. 8 * 9 * Solarus Quest Editor is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License along 15 * with this program. If not, see <http://www.gnu.org/licenses/>. 16 */ 17 #ifndef SOLARUSEDITOR_GROUND_TRAITS_H 18 #define SOLARUSEDITOR_GROUND_TRAITS_H 19 20 #include "enum_traits.h" 21 #include <solarus/entities/Ground.h> 22 23 namespace SolarusEditor { 24 25 using Ground = Solarus::Ground; 26 using GroundTraits = EnumTraits<Ground>; 27 28 /** 29 * \brief Provides useful properties of ground enum values. 30 */ 31 template<> 32 class EnumTraits<Ground> { 33 34 public: 35 36 static QList<Ground> get_values(); 37 static QString get_friendly_name(Ground value); 38 static QIcon get_icon(Ground value); 39 40 static QString get_lua_name(Ground value); 41 static Ground get_by_lua_name(const QString& name); 42 43 static bool is_traversable(Ground value); 44 45 }; 46 47 } 48 49 #endif 50