LLib/Shop/Model/PurchaseState.cs

20 lines
537 B
C#
Raw Normal View History

2024-09-22 11:46:38 +00:00
using System;
2024-09-22 21:02:22 +00:00
namespace LLib.Shop.Model;
2024-09-22 11:46:38 +00:00
public sealed class PurchaseState
{
public PurchaseState(int desiredItems, int ownedItems)
{
DesiredItems = desiredItems;
OwnedItems = ownedItems;
}
public int DesiredItems { get; }
public int OwnedItems { get; set; }
public int ItemsLeftToBuy => Math.Max(0, DesiredItems - OwnedItems);
public bool IsComplete => ItemsLeftToBuy == 0;
public bool IsAwaitingYesNo { get; set; }
public DateTime NextStep { get; set; } = DateTime.MinValue;
}