53 lines
1.4 KiB
C#
53 lines
1.4 KiB
C#
|
|
using OpenTheBox.Core.Enums;
|
||
|
|
|
||
|
|
namespace OpenTheBox.Simulation.Actions;
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Base type for all player-initiated actions in the game.
|
||
|
|
/// </summary>
|
||
|
|
public abstract record GameAction
|
||
|
|
{
|
||
|
|
public DateTime Timestamp { get; init; } = DateTime.UtcNow;
|
||
|
|
}
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Player opens a box from their inventory.
|
||
|
|
/// </summary>
|
||
|
|
public sealed record OpenBoxAction(Guid BoxInstanceId) : GameAction
|
||
|
|
{
|
||
|
|
/// <summary>
|
||
|
|
/// The definition id of the box being opened.
|
||
|
|
/// </summary>
|
||
|
|
public string? BoxDefinitionId { get; init; }
|
||
|
|
}
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Player uses an item from their inventory.
|
||
|
|
/// </summary>
|
||
|
|
public sealed record UseItemAction(Guid ItemInstanceId) : GameAction;
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Player crafts at a workstation using material items.
|
||
|
|
/// </summary>
|
||
|
|
public sealed record CraftAction(WorkstationType Station, List<Guid> MaterialIds) : GameAction;
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Player starts an adventure.
|
||
|
|
/// </summary>
|
||
|
|
public sealed record StartAdventureAction(AdventureTheme Theme) : GameAction;
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Player changes the game locale.
|
||
|
|
/// </summary>
|
||
|
|
public sealed record ChangeLocaleAction(Locale NewLocale) : GameAction;
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Player equips a cosmetic item.
|
||
|
|
/// </summary>
|
||
|
|
public sealed record EquipCosmeticAction(Guid ItemInstanceId) : GameAction;
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Player saves the game to a named slot.
|
||
|
|
/// </summary>
|
||
|
|
public sealed record SaveGameAction(string SlotName) : GameAction;
|