Skip to content

Commit

Permalink
Add parametrized cheats
Browse files Browse the repository at this point in the history
  • Loading branch information
hermer29 committed Oct 4, 2023
1 parent 67203f5 commit e2bc1fd
Show file tree
Hide file tree
Showing 14 changed files with 587 additions and 36 deletions.
25 changes: 21 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
# cheats

Library to simplify the creation of cheats for testing and debugging features

# Installation

To install the package, you can add it in package manager using the git url:

`https://github.com/hermer29/cheats.git#v1.0.0`
`https://github.com/hermer29/cheats.git#v1.1.0`

# Quick Start

To start using cheats, you need to implement the interface `ICheatHandler`
To start using cheats without parameters, you need to implement the interface `ICheatHandler`

```csharp
namespace Hermer29.Cheats
namespace Hermer29.Cheats
{
public interface ICheatHandler
{
Expand All @@ -25,7 +26,23 @@ To start using cheats, you need to implement the interface `ICheatHandler`
- `GetCheatCode()` method returns case insensitive cheat code, which can later be used in the cheat menu
- `Execute()` implements the operation that will be performed when typing this cheat code

Next you need to pass instances of this interface to the first parameter of the method `Cheats.Create`.
To start using cheats with parameters, you need to implement the interface `IParametrizedCheatHandler`

```csharp
namespace Hermer29.Cheats
{
public interface IParametrizedCheatHandler : ICheatHandler
{
string Description { get; }
void Execute(string[] args);
}
}
```

- `Description` property returns description of the cheat and its parameters
- `Execute(string[] args)` implements the operation that will be performed when typing this cheat code and pressing submit button, the passed parameters will be passed to the method

Next you need to pass instances of this interfaces to the first parameter of the method `Cheats.Create`.
You can redefine the key to which the cheat menu will open by passing the KeyCode of the key to the second parameter

## Cockpit
Expand Down
Loading

0 comments on commit e2bc1fd

Please sign in to comment.