mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-05-02 04:22:04 -04:00
Created initial models for kasino events
This commit is contained in:
@@ -289,7 +289,7 @@ public enum WagerGame
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
Event,
|
Event,
|
||||||
[Description("Guess what number I'm thinking of")]
|
[Description("Guess what number I'm thinking of")]
|
||||||
GuessWhatNumber
|
GuessWhatNumber,
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum GamblerState
|
public enum GamblerState
|
||||||
|
|||||||
@@ -1,3 +1,40 @@
|
|||||||
namespace KfChatDotNetBot.Models;
|
namespace KfChatDotNetBot.Models;
|
||||||
|
|
||||||
// Stash all the models used for perk or game metadata here
|
// Stash all the models used for perk or game metadata here
|
||||||
|
public class KasinoWagerBaseEventMetaModel
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Event type for this meta model for the purposes of figuring out which model to use when deserializing
|
||||||
|
/// </summary>
|
||||||
|
public required KasinoEventType EventType { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Unique reference tracking the shared event ID stored in the settings
|
||||||
|
/// </summary>
|
||||||
|
public required string SharedEventId { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// How long it took the user to make a selection. This is based on the event announcement msg recv - sent timestamp
|
||||||
|
/// that SneedChat provided so the bot won't unfairly penalize users who were delayed by chat lag
|
||||||
|
/// </summary>
|
||||||
|
public required TimeSpan SelectionDelay { get; set; }
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Metadata model tracking a gambler's wager information related to win/lose games specifically
|
||||||
|
/// </summary>
|
||||||
|
public class KasinoWagerWinLoseEventMetaModel : KasinoWagerBaseEventMetaModel
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Unique reference tracking the option the gambler selected. Tracked as a GUID in case the option text changes
|
||||||
|
/// </summary>
|
||||||
|
public required string OptionId { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Metadata model tracking a gambler's wager information related to win/lose games specifically
|
||||||
|
/// </summary>
|
||||||
|
public class KasinoWagerPredictionEventMetaModel : KasinoWagerBaseEventMetaModel
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The absolute time when the user predicted the thing was going to happen
|
||||||
|
/// </summary>
|
||||||
|
public required DateTimeOffset PredictedTime { get; set; }
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
using KfChatDotNetBot.Models.DbModels;
|
using System.ComponentModel;
|
||||||
|
|
||||||
namespace KfChatDotNetBot.Models;
|
namespace KfChatDotNetBot.Models;
|
||||||
|
|
||||||
@@ -55,3 +55,92 @@ public class NextVipLevelModel
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public required decimal WagerRequirement { get; set; }
|
public required decimal WagerRequirement { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class KasinoEventModel
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Text summary of the event itself such as: "How long until the chase ends?" or "Parole granted?"
|
||||||
|
/// </summary>
|
||||||
|
public required string EventText { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Unique reference used for tying this event to wagers gamblers are placing
|
||||||
|
/// </summary>
|
||||||
|
public required string EventId { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// The set of options available for gamblers to select. This is only applicable to WinLose-type bets
|
||||||
|
/// It'll be an empty array for closest to finish
|
||||||
|
/// </summary>
|
||||||
|
public required List<KasinoEventOptionModel> Options { get; set; } = [];
|
||||||
|
/// <summary>
|
||||||
|
/// The type of event this is, which is important for the purposes of calculating the payout correctly
|
||||||
|
/// </summary>
|
||||||
|
public required KasinoEventType EventType { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Timestamp of when the announcement message was received by the client for the purposes of calculating selection
|
||||||
|
/// delay. This value is null when the message hasn't been seen yet (either event not started or message lost.
|
||||||
|
/// Do not accept wagers where this is null.
|
||||||
|
/// </summary>
|
||||||
|
public DateTimeOffset? EventAnnouncementReceived { get; set; } = null;
|
||||||
|
/// <summary>
|
||||||
|
/// State of the kasino event
|
||||||
|
/// </summary>
|
||||||
|
public required KasinoEventState EventState { get; set; } = KasinoEventState.Incomplete;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class KasinoEventOptionModel
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Unique reference used for tying a gambler's selection to a given option
|
||||||
|
/// </summary>
|
||||||
|
public required string OptionId { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Text to describe the option that users are picking
|
||||||
|
/// </summary>
|
||||||
|
public required string OptionText { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Whether this option won or not, null while incomplete
|
||||||
|
/// </summary>
|
||||||
|
public bool? Won { get; set; } = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum KasinoEventType
|
||||||
|
{
|
||||||
|
[Description("Win/Lose")]
|
||||||
|
WinLose,
|
||||||
|
[Description("Closest to prediction")]
|
||||||
|
Prediction,
|
||||||
|
[Description("Closest to prediction (payout weighted to favor early bets)")]
|
||||||
|
PredictionSelectionTimeWeighted,
|
||||||
|
[Description("Win/Lose (payout weighted to favor early bets)")]
|
||||||
|
WinLoseSelectionTimeWeighted
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum KasinoEventState
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Event still under construction. This is the initial state when an admin creates an event but hasn't yet launched it
|
||||||
|
/// </summary>
|
||||||
|
Incomplete,
|
||||||
|
/// <summary>
|
||||||
|
/// Event has been launched but the announcement message hasn't yet been acknowledged by Sneedchat
|
||||||
|
/// No bets will be processed until the message is seen
|
||||||
|
/// If the message is ultimately lost, the event will never launch
|
||||||
|
/// </summary>
|
||||||
|
PendingAnnouncement,
|
||||||
|
/// <summary>
|
||||||
|
/// The event announcement message was seen, the event has started and wagers can now be placed
|
||||||
|
/// </summary>
|
||||||
|
Started,
|
||||||
|
/// <summary>
|
||||||
|
/// Closed to new wagers but the event is still ongoing
|
||||||
|
/// </summary>
|
||||||
|
Closed,
|
||||||
|
/// <summary>
|
||||||
|
/// Event has closed, it's so over.
|
||||||
|
/// </summary>
|
||||||
|
Over,
|
||||||
|
/// <summary>
|
||||||
|
/// Event was abandoned and all wagers canceled
|
||||||
|
/// </summary>
|
||||||
|
Abandoned
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user