本文整理汇总了C#中System.Color.Clone方法的典型用法代码示例。如果您正苦于以下问题:C# Color.Clone方法的具体用法?C# Color.Clone怎么用?C# Color.Clone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Color
的用法示例。
在下文中一共展示了Color.Clone方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FindPossibleClicks
/// <summary>
/// Finds all possible clicks on a single board, their result states and the result evaluations.
/// </summary>
/// <param name="matrix"></param>
/// <returns></returns>
private List<TapResult> FindPossibleClicks(Color[,] matrix, bool optimizeForSingleSolution, int clicksLeft)
{
List<TapResult> result = new List<TapResult>();
// Find all possible clicks on the board, add them to the possible solutions list
for (int x = 0; x < 5; x++)
{
for (int y = 0; y < 6; y++)
{
if ((matrix[x, y] != Color.None) && ((int)matrix[x,y] <= clicksLeft))
{
Color[,] cloneMatrix = matrix.Clone() as Color[,];
TapResult r = Tap(cloneMatrix, x, y);
result.Add(r);
// If the last result was a solution, there's no need to check for other results
if ((optimizeForSingleSolution) && (r.Estimate == Int32.MaxValue))
{
return result;
}
}
}
}
// Sort the list
return result.OrderByDescending(q => q.Estimate).ToList();
}