mines update (#68)

* mines update

mines update

* Refactor betting logic to use valid coordinates

Refactor betting logic to use valid coordinates

* Refactor bet coordinate selection logic

Refactor random bet coordinate selection to improve clarity and prevent duplicate entries.

* update tostring

update tostring

* Refactor Bet method and update gem handling

Refactor Bet method to include an additional parameter for tracking calls. Update logic for handling gem counts and cash-out conditions.

* update regex

update regex
This commit is contained in:
alogindtractor
2026-02-07 18:33:58 -08:00
committed by GitHub
parent 6a47d0d25e
commit 670336145d

View File

@@ -12,18 +12,18 @@ namespace KfChatDotNetBot.Commands.Kasino;
public class MinesCommand : ICommand public class MinesCommand : ICommand
{ {
public List<Regex> Patterns => [ public List<Regex> Patterns => [
//cashout
new Regex(@"^mines(?<cashout> cashout)$", RegexOptions.IgnoreCase),
//refresh
new Regex(@"^mines(?<refresh> refresh)$", RegexOptions.IgnoreCase),
//attempting to start a game below here //attempting to start a game below here
new Regex(@"^mines (?<bet>\d+(?:\.\d+)?) (?<size>\d+) (?<mines>\d+) (?<picks>\d+)(?<cashout> cashout|)$", RegexOptions.IgnoreCase), new Regex(@"^mines (?<bet>\d+(?:\.\d+)?) (?<size>\d+) (?<mines>\d+) (?<picks>\d+)(?<cashout> cashout|)$", RegexOptions.IgnoreCase),
new Regex(@"^mines (?<bet>\d+(?:\.\d+)?) (?<size>\d+) (?<mines>\d+) (?<betString>.+)(?<cashout> cashout|)$", RegexOptions.IgnoreCase), new Regex(@"^mines (?<bet>\d+(?:\.\d+)?) (?<size>\d+) (?<mines>\d+) (?<betString>.+)(?<cashout> cashout|)$", RegexOptions.IgnoreCase),
//attempting to continue a game below here //attempting to continue a game below here
new Regex(@"^mines (?<picks>\d+)(?<cashout> cashout|)$", RegexOptions.IgnoreCase), new Regex(@"^mines (?<picks>\d+)(?<cashout> cashout|)$", RegexOptions.IgnoreCase),
new Regex(@"^mines (?<betString>.+)(?<cashout> cashout|)$", RegexOptions.IgnoreCase), new Regex(@"^mines (?<betString>.+)(?<cashout> cashout|)$", RegexOptions.IgnoreCase),
//cashout
new Regex(@"^mines(?<cashout> cashout)$", RegexOptions.IgnoreCase),
//refresh
new Regex(@"^mines(?<refresh> refresh)$", RegexOptions.IgnoreCase),
//get info //get info
new Regex("^mines") new Regex("^mines$")
]; ];
public string? HelpText => "!mines <bet> <board size> <number of mines> <picks> to play simple mines. !mines <bet> <board size> <number of mines> <betString> for advanced mines. Tool: https://i.ddos.lgbt/raw/UJ9Dty.html"; public string? HelpText => "!mines <bet> <board size> <number of mines> <picks> to play simple mines. !mines <bet> <board size> <number of mines> <betString> for advanced mines. Tool: https://i.ddos.lgbt/raw/UJ9Dty.html";
public UserRight RequiredRight => UserRight.Loser; public UserRight RequiredRight => UserRight.Loser;