本文整理汇总了C#中Cell.RotateCW方法的典型用法代码示例。如果您正苦于以下问题:C# Cell.RotateCW方法的具体用法?C# Cell.RotateCW怎么用?C# Cell.RotateCW使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cell
的用法示例。
在下文中一共展示了Cell.RotateCW方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RotateTests
public void RotateTests()
{
var cell = new Cell { x = 0, y = 0, filled = false };
var pivot = new Cell {x = 0, y = 1};
cell = cell.RotateCW(pivot);
CheckEqual(cell, 1, 0);
cell = cell.RotateCW(pivot);
CheckEqual(cell, 1, 1);
cell = cell.RotateCW(pivot);
CheckEqual(cell, 1, 2);
cell = cell.RotateCW(pivot);
CheckEqual(cell, 0, 2);
cell = cell.RotateCCW(pivot);
CheckEqual(cell, 1, 2);
pivot = new Cell { x = 2, y = 3 };
cell = cell.RotateCCW(pivot);
CheckEqual(cell, 1, 4);
cell = cell.RotateCCW(pivot);
CheckEqual(cell, 2, 5);
cell = cell.RotateCCW(pivot);
CheckEqual(cell, 4, 4);
pivot = new Cell { x = 1, y = 5 };
cell = cell.RotateCW(pivot);
CheckEqual(cell, 3, 7);
}
示例2: RotateTests_NegativeCoords_BugFixed
public void RotateTests_NegativeCoords_BugFixed()
{
var pivot = new Cell {x = 1, y = -1};
var cell = new Cell {x = 3, y = 0};
cell = cell.RotateCW(pivot);
CheckEqual(cell, 1, 1);
cell = new Cell {x = 2, y = 1};
cell = cell.RotateCW(pivot);
CheckEqual(cell, 0, 1);
cell = new Cell {x = 1, y = 1};
cell = cell.RotateCW(pivot);
CheckEqual(cell, 0, 0);
}