citra/src/core/cheats/cheat_base.h
zhupengfei 573036b38e
core/cheats: Add and change a few functions
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`.
2019-02-02 08:15:23 +08:00

30 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