mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 00:10:06 +00:00 
			
		
		
		
	Inheriting MapSettings and PaletteSettings from SettingsCategory, updating SettingsManager initialization
This commit is contained in:
		
							parent
							
								
									c93e776137
								
							
						
					
					
						commit
						891b6c839f
					
				
					 14 changed files with 231 additions and 269 deletions
				
			
		|  | @ -1,12 +1,11 @@ | |||
| #pragma once | ||||
| 
 | ||||
| #include <scwx/common/products.hpp> | ||||
| #include <scwx/qt/settings/settings_category.hpp> | ||||
| 
 | ||||
| #include <memory> | ||||
| #include <string> | ||||
| 
 | ||||
| #include <boost/json.hpp> | ||||
| 
 | ||||
| namespace scwx | ||||
| { | ||||
| namespace qt | ||||
|  | @ -16,28 +15,39 @@ namespace settings | |||
| 
 | ||||
| class MapSettingsImpl; | ||||
| 
 | ||||
| class MapSettings | ||||
| class MapSettings : public SettingsCategory | ||||
| { | ||||
| public: | ||||
|    explicit MapSettings(); | ||||
|    ~MapSettings(); | ||||
| 
 | ||||
|    MapSettings(const MapSettings&) = delete; | ||||
|    MapSettings(const MapSettings&)            = delete; | ||||
|    MapSettings& operator=(const MapSettings&) = delete; | ||||
| 
 | ||||
|    MapSettings(MapSettings&&) noexcept; | ||||
|    MapSettings& operator=(MapSettings&&) noexcept; | ||||
| 
 | ||||
|    size_t                    count() const; | ||||
|    std::string               radar_site(size_t i) const; | ||||
|    common::RadarProductGroup radar_product_group(size_t i) const; | ||||
|    std::string               radar_product(size_t i) const; | ||||
|    std::size_t               count() const; | ||||
|    std::string               radar_site(std::size_t i) const; | ||||
|    common::RadarProductGroup radar_product_group(std::size_t i) const; | ||||
|    std::string               radar_product(std::size_t i) const; | ||||
| 
 | ||||
|    boost::json::value ToJson() const; | ||||
|    /**
 | ||||
|     * Reads the variables from the JSON object. | ||||
|     * | ||||
|     * @param json JSON object to read | ||||
|     * | ||||
|     * @return true if the values read are valid, false if any values were | ||||
|     * modified. | ||||
|     */ | ||||
|    bool ReadJson(const boost::json::object& json) override; | ||||
| 
 | ||||
|    static std::shared_ptr<MapSettings> Create(); | ||||
|    static std::shared_ptr<MapSettings> Load(const boost::json::value* json, | ||||
|                                             bool& jsonDirty); | ||||
|    /**
 | ||||
|     * Writes the variables to the JSON object. | ||||
|     * | ||||
|     * @param json JSON object to write | ||||
|     */ | ||||
|    void WriteJson(boost::json::object& json) const override; | ||||
| 
 | ||||
|    friend bool operator==(const MapSettings& lhs, const MapSettings& rhs); | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat