本文整理汇总了C#中Cell.SetState方法的典型用法代码示例。如果您正苦于以下问题:C# Cell.SetState方法的具体用法?C# Cell.SetState怎么用?C# Cell.SetState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cell
的用法示例。
在下文中一共展示了Cell.SetState方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: NoNeighboursKillsCell
public void NoNeighboursKillsCell()
{
var cell = new Cell { IsAlive = true };
cell.SetState(new ICell[0]);
Assert.That(cell.IsAlive, Is.False);
}
示例2: FourNeighboursKillsCell
public void FourNeighboursKillsCell()
{
var cell = new Cell { IsAlive = true };
cell.SetState(new[] { LiveCell, LiveCell, LiveCell, LiveCell });
Assert.That(cell.IsAlive, Is.False);
}
示例3: DeadCellsHaveNoEffect
public void DeadCellsHaveNoEffect()
{
var cell = new Cell { IsAlive = true };
cell.SetState(new [] {DeadCell, DeadCell, DeadCell, DeadCell
});
Assert.That(cell.IsAlive, Is.False);
}
示例4: SetStateAssignsSpecifiedStateToContext
public void SetStateAssignsSpecifiedStateToContext()
{
var cell = new Cell();
cell.SetState(CellState.Revealed);
ICell context = cell.GetContext();
Assert.AreEqual(default(object), context.Content);
Assert.AreEqual(CellState.Revealed, context.State);
}
示例5: ThreeNeighboursCreatesCell
public void ThreeNeighboursCreatesCell()
{
var cell = new Cell();
cell.SetState(new[] { LiveCell, LiveCell, LiveCell });
Assert.That(cell.IsAlive, Is.True);
}
示例6: TwoNeighboursKeepsCellDead
public void TwoNeighboursKeepsCellDead()
{
var cell = new Cell();
cell.SetState(new[] { LiveCell, LiveCell });
Assert.That(cell.IsAlive, Is.False);
}
示例7: TwoNeighboursKeepsCellAlive
public void TwoNeighboursKeepsCellAlive()
{
var cell = new Cell { IsAlive = true };
cell.SetState(new [] { LiveCell, LiveCell });
Assert.That(cell.IsAlive, Is.True);
}