Workship/Workshoppa/GameData/CraftState.cs

17 lines
530 B
C#
Raw Normal View History

2023-10-04 22:07:36 +00:00
using System.Collections.Generic;
2023-10-01 20:50:21 +00:00
using System.Linq;
namespace Workshoppa.GameData;
public sealed class CraftState
{
public required uint ResultItem { get; init; }
public required uint StepsComplete { get; init; }
public required uint StepsTotal { get; init; }
public required List<CraftItem> Items { get; init; }
public bool IsPhaseComplete() => Items.All(x => x.Finished || x.StepsComplete == x.StepsTotal);
public bool IsCraftComplete() => StepsComplete == StepsTotal - 1 && IsPhaseComplete();
}