本文整理汇总了C#中IWorld.RunActively方法的典型用法代码示例。如果您正苦于以下问题:C# IWorld.RunActively方法的具体用法?C# IWorld.RunActively怎么用?C# IWorld.RunActively使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IWorld
的用法示例。
在下文中一共展示了IWorld.RunActively方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: KroRForm
public KroRForm(IWorld world)
{
this.world=world;
ClientSize = new System.Drawing.Size(800, 600);
var font=new Font("Arial", 18);
clocks=new Label();
clocks.Size=new Size(100,50);
clocks.Location=new Point(ClientSize.Width-clocks.Width,0);
clocks.Font=font;
clocks.BackColor=Color.White;
Controls.Add(clocks);
scores = new Label();
scores.BackColor = Color.White;
scores.Font = font;
scores.Size = new Size(ClientSize.Width-clocks.Width, clocks.Height);
scores.BringToFront();
Controls.Add(scores);
var engine = world.Engine as KroREngine;
var control = new DrawerControl(new DirectXFormDrawer(engine.DrawerFactory.GetDirectXScene(), new DrawerSettings
{
ViewMode = ViewModes.FirstPerson,
BodyCameraLocation = world.Configuration.Settings.ObserverCameraLocation,
Robot = engine.Root
}));
control.Size = new Size(ClientSize.Width,ClientSize.Height-scores.Height);
control.Location = new Point(0, scores.Height);
Controls.Add(control);
world.Scores.ScoresChanged += () => { Invoke(new Action(UpdateScores)); };
world.Clocks.Ticked += () => { Invoke(new Action(UpdateClocks)); };
world.Exit += () => worldExited = true;
UpdateScores();
thread= new Thread(()=>world.RunActively(1)) { IsBackground = true };
thread.Start();
}