本文整理汇总了C#中GameEngine.Render方法的典型用法代码示例。如果您正苦于以下问题:C# GameEngine.Render方法的具体用法?C# GameEngine.Render怎么用?C# GameEngine.Render使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameEngine
的用法示例。
在下文中一共展示了GameEngine.Render方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RunGame
private static void RunGame(GameEngine engine, string initialState, int generations)
{
engine.InitializeGame(initialState);
Console.ForegroundColor = ConsoleColor.Red;
for(int generation = 0; generation < generations ; generation++ )
{
Console.SetCursorPosition(0, 7);
engine.Render();
Thread.Sleep(500); // wait for half a second
engine.Move(1);
}
Console.ResetColor();
}
示例2: TestGameEngineRender
public void TestGameEngineRender()
{
var engine = new GameEngine(4, 4);
engine.InitializeGame("0100101001");
using (var sw = new StringWriter())
{
Console.SetOut(sw);
using (var sr = new StringReader(""))
{
Console.SetIn(sr);
engine.Render();
string expected = string.Format(" # {0}# # {1} # {2} {3}", Environment.NewLine,
Environment.NewLine, Environment.NewLine, Environment.NewLine);
Assert.AreEqual(expected, sw.ToString());
}
}
}