Change ProjectSettings to Singleton interface
Signed-off-by: nggieber <52797929+AMZN-nggieber@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <SettingsInterface.h>
|
||||
|
||||
#include <AzCore/std/containers/set.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
class SettingsRegistryInterface;
|
||||
}
|
||||
|
||||
namespace O3DE::ProjectManager
|
||||
{
|
||||
class Settings
|
||||
: public SettingsInterface::Registrar
|
||||
{
|
||||
public:
|
||||
Settings(bool saveToDisk = true);
|
||||
|
||||
bool IsInitialized() override;
|
||||
|
||||
bool Get(QString& result, const QString& settingsKey) override;
|
||||
bool Get(bool& result, const QString& settingsKey) override;
|
||||
bool Set(const QString& settingsKey, const QString& settingsValue) override;
|
||||
bool Set(const QString& settingsKey, bool settingsValue) override;
|
||||
bool Remove(const QString& settingsKey) override;
|
||||
bool Copy(const QString& settingsKeyOrig, const QString& settingsKeyDest, bool removeOrig = false) override;
|
||||
|
||||
QString GetProjectKey(const ProjectInfo& projectInfo) override;
|
||||
|
||||
bool GetProjectBuiltSuccessfully(bool& result, const ProjectInfo& projectInfo) override;
|
||||
bool SetProjectBuiltSuccessfully(const ProjectInfo& projectInfo, bool successfullyBuilt) override;
|
||||
|
||||
private:
|
||||
bool Save();
|
||||
|
||||
bool GetBuiltSuccessfullyPaths(AZStd::set<AZStd::string>& result);
|
||||
|
||||
bool m_saveToDisk;
|
||||
AZ::SettingsRegistryInterface* m_settingsRegistry = nullptr;
|
||||
};
|
||||
} // namespace O3DE::ProjectManager
|
||||
Reference in New Issue
Block a user