573036b38e
Added a few interfaces for adding/deleting/replacing/saving cheats. The cheats list is guarded by a std::shared_mutex, and would only need a exclusive lock when it's being updated. I marked the `Execute` function as `const` to avoid accidentally changing the internal state of the cheat on execution, so that execution can be considered a "read" operation which only needs a shared lock. Whether a cheat is enabled or not is now saved by a special comment line `*citra_enabled`.
29 lines
671 B
C++
29 lines
671 B
C++
// Copyright 2018 Citra Emulator Project
|
|
// Licensed under GPLv2 or any later version
|
|
// Refer to the license.txt file included.
|
|
|
|
#pragma once
|
|
|
|
#include <string>
|
|
|
|
namespace Core {
|
|
class System;
|
|
}
|
|
|
|
namespace Cheats {
|
|
class CheatBase {
|
|
public:
|
|
virtual ~CheatBase();
|
|
virtual void Execute(Core::System& system) const = 0;
|
|
|
|
virtual bool IsEnabled() const = 0;
|
|
virtual void SetEnabled(bool enabled) = 0;
|
|
|
|
virtual std::string GetComments() const = 0;
|
|
virtual std::string GetName() const = 0;
|
|
virtual std::string GetType() const = 0;
|
|
virtual std::string GetCode() const = 0;
|
|
|
|
virtual std::string ToString() const = 0;
|
|
};
|
|
} // namespace Cheats
|