diff options
Diffstat (limited to 'Source/Core/VideoCommon/GraphicsModSystem/Runtime/GraphicsModActionFactory.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/GraphicsModSystem/Runtime/GraphicsModActionFactory.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/GraphicsModSystem/Runtime/GraphicsModActionFactory.cpp b/Source/Core/VideoCommon/GraphicsModSystem/Runtime/GraphicsModActionFactory.cpp new file mode 100644 index 0000000000..5eaac88c25 --- /dev/null +++ b/Source/Core/VideoCommon/GraphicsModSystem/Runtime/GraphicsModActionFactory.cpp @@ -0,0 +1,34 @@ +// Copyright 2022 Dolphin Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "VideoCommon/GraphicsModSystem/Runtime/GraphicsModActionFactory.h" + +#include "VideoCommon/GraphicsModSystem/Runtime/Actions/MoveAction.h" +#include "VideoCommon/GraphicsModSystem/Runtime/Actions/PrintAction.h" +#include "VideoCommon/GraphicsModSystem/Runtime/Actions/ScaleAction.h" +#include "VideoCommon/GraphicsModSystem/Runtime/Actions/SkipAction.h" + +namespace GraphicsModActionFactory +{ +std::unique_ptr<GraphicsModAction> Create(std::string_view name, const picojson::value& json_data) +{ + if (name == "print") + { + return std::make_unique<PrintAction>(); + } + else if (name == "skip") + { + return std::make_unique<SkipAction>(); + } + else if (name == "move") + { + return MoveAction::Create(json_data); + } + else if (name == "scale") + { + return ScaleAction::Create(json_data); + } + + return nullptr; +} +} // namespace GraphicsModActionFactory |
