本文整理匯總了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();
}