本文整理汇总了C#中Struct.Clone方法的典型用法代码示例。如果您正苦于以下问题:C# Struct.Clone方法的具体用法?C# Struct.Clone怎么用?C# Struct.Clone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Struct
的用法示例。
在下文中一共展示了Struct.Clone方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Dfs
public static List<Struct.DoubleIndex> Dfs(char [,] map, Struct.DoubleIndex current, Struct.DoubleIndex target, char wall, bool isNew = true)
{
if (isNew) {
currentPath.Clear ();
bestPath = null;
}
currentPath.Insert (0, current.Clone());
if (current.Equals (target) && (bestPath == null || bestPath.Count > currentPath.Count))
bestPath = new List<Struct.DoubleIndex> (currentPath);
if (bestPath != null && bestPath.Count <= currentPath.Count)
return bestPath;
for (int i = 0; i < directionsX.Length; i++) {
current.first += directionsY[i];
current.second += directionsX[i];
if(!currentPath.Contains(current) && CanMove(map, current, wall))
Dfs (map, current, target, wall, false);
current.first -= directionsY[i];
current.second -= directionsX[i];
}
currentPath.RemoveAt (0);
return bestPath;
}
示例2: Struct
public void Struct()
{
Struct inter = new Struct(controller);
inter.Name = "Struct1";
inter.BaseNames.Add("ValueType");
inter.GenericTypes.Add("T");
Assert.That(inter.IsTheSame(inter.Clone(), ComparisonDepth.Outer), Is.True);
}