mines update (#67)

* 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.
This commit is contained in:
alogindtractor
2026-02-07 14:10:19 -08:00
committed by GitHub
parent eccbe44acd
commit 6a47d0d25e
2 changed files with 100 additions and 11 deletions

View File

@@ -142,7 +142,7 @@ public class MinesCommand : ICommand
int minesCount = Convert.ToInt32(mines.Value);
if (minesCount < 1 || minesCount > (boardSize * boardSize) - 1)
{
await botInstance.SendChatMessageAsync($"{user.FormatUsername()}, number of mines must be between 1 and {boardSize * boardSize - 1}(boardSize * boardSize - 1).",true, autoDeleteAfter: cleanupDelay);
await botInstance.SendChatMessageAsync($"{user.FormatUsername()}, number of mines must be between 1 and {boardSize * boardSize - 1}(size^2 - 1).",true, autoDeleteAfter: cleanupDelay);
return;
}
//at this point all valid values so good to continue making the game
@@ -185,6 +185,11 @@ public class MinesCommand : ICommand
}
else if (arguments.TryGetValue("betString", out var betString)) //if they are using precise picks manually or from the tool to select specific squares to reveal
{
if (betString.Value == "cashout" || betString.Value == " cashout")
{
await KasinoMines.Cashout(KasinoMines.ActiveGames[gambler.Id]);
return;
}
var matches = Regex.Matches(message.Message, BetPattern);
if (matches.Count == 0 || matches == null) //if invalid bet string
{