本文整理汇总了C#中ICell.GetNextState方法的典型用法代码示例。如果您正苦于以下问题:C# ICell.GetNextState方法的具体用法?C# ICell.GetNextState怎么用?C# ICell.GetNextState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICell
的用法示例。
在下文中一共展示了ICell.GetNextState方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Birth_if_three_living_neighbours
private void Birth_if_three_living_neighbours(ICell cell)
{
var neighboursAlive = cell.Neighbours.Count(x => x.State == CellState.Alive);
if (cell.State == CellState.Dead && neighboursAlive == 3)
Assert.That(cell.GetNextState(), Is.EqualTo(CellState.Alive));
}
示例2: Survival_if_two_or_three_living_neigbours
private void Survival_if_two_or_three_living_neigbours(ICell cell)
{
var neighboursAlive = cell.Neighbours.Count(x => x.State == CellState.Alive);
if (cell.State == CellState.Alive && (neighboursAlive == 2 || neighboursAlive == 3))
Assert.That(cell.GetNextState(), Is.EqualTo(CellState.Alive));
else
Assert.Inconclusive();
}
示例3: Less_than_two_neighbours_death
private static void Less_than_two_neighbours_death(ICell cell)
{
if (cell.Neighbours.Count(x => x.State == CellState.Alive) < 2)
Assert.That(cell.GetNextState(), Is.EqualTo(CellState.Dead));
}
示例4: More_than_three_living_neigbours_death
private void More_than_three_living_neigbours_death(ICell cell)
{
if (cell.Neighbours.Count(x => x.State == CellState.Alive) > 3)
Assert.That(cell.GetNextState(), Is.EqualTo(CellState.Dead));
}