예제 #1
0
 /// <summary>
 /// *勝利* 組札に全て移動した
 /// </summary>
 /// <param name="klondike"></param>
 /// <returns></returns>
 public static bool IsWin(this Klondike klondike) => klondike.All(pair => pair.Value is Foundation);
예제 #2
0
 /// <summary>
 /// 勝利目前 全てのカードが組札か、タブローで表
 /// </summary>
 /// <param name="klondike"></param>
 /// <returns></returns>
 public static bool IsPreWin(this Klondike klondike) => klondike.All(pair => pair.Value is Foundation || (pair.Value is Tableau tableau && tableau.Open));
예제 #3
0
 /// <summary>
 /// 残り山札枚数
 /// </summary>
 /// <param name="klondike"></param>
 /// <returns></returns>
 public static int StockCount(this Klondike klondike) => klondike.Count(pair => pair.Value is Stock);