KoogleV4/GameModel/PinThrow.cs

23 lines
627 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GameModel
{
public record PinThrow(PinPicture PicPicture, bool IsBell, bool IsSink)
{
public bool IsCircle => !IsSink && PicPicture.DownCount == 8 && (PicPicture[5] == PinState.Up);
public bool IsNinePins => !IsSink && PinCount == 9;
/// <summary>
/// Count of hit pins with this throw
/// </summary>
public int PinCount => IsSink ? 0 : PicPicture.DownCount;
public bool IsNoWood => PicPicture.DownCount == 0 && !IsSink;
}
}