本文整理汇总了C#中Root.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# Root.Dispose方法的具体用法?C# Root.Dispose怎么用?C# Root.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Root
的用法示例。
在下文中一共展示了Root.Dispose方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ClientMain
public static void ClientMain(string[] args)
{
Root r = new Root(args, false);
r.ClientClient(args);
IUserInterface ui = r.UserInterface;
Flow f = new SpaceWar2006.Flows.ClientStart();
r.CurrentFlow = f;
f.Start();
r.ClientLoop();
r.Dispose();
}
示例2: ConsoleMain
public static void ConsoleMain(string[] args)
{
Root r = new Root(args, false);
SpaceWar2006.GameSystem.Mod.Instance.Init();
ServerFinder scanner = new ServerFinder(Answer,true,true);
for (int i = 0; i < 50; ++i)
{
scanner.Tick(0.1f);
Thread.Sleep(100);
}
System.Console.WriteLine("---------SERVERS----------");
List<IPEndPoint> list = new List<IPEndPoint>();
int j = 0;
foreach (KeyValuePair<IPEndPoint, GameSystem.GameServerInfo> kv in servers)
{
list.Add(kv.Key);
j++;
System.Console.Write("["+ j.ToString()+"] "+kv.Key.ToString()+": ");
System.Console.WriteLine(kv.Value.ToString());
}
System.Console.WriteLine("--------------------------");
System.Console.Write("select server: ");
int select = int.Parse(System.Console.ReadLine()) - 1;
IPEndPoint connect = list[select];
System.Console.WriteLine("Connecting to "+connect.ToString()+"...");
args = new string[] { "client", "-connect", connect.ToString() };
Root.Instance.Args = args;
r.ClientClient(args);
Flow f = new SpaceWar2006.Flows.ClientStart();
r.CurrentFlow = f;
f.Start();
r.ClientLoop();
r.Dispose();
}
示例3: ServerMain
static void ServerMain(string[] args)
{
Root r = new Root(args, true);
r.ServerServer(args);
Mod.Instance.Init();
r.NextIndex += 10;
while (!Root.Instance.Quit)
{
Flow f = new PhysicsServer();
r.CurrentFlow = f;
f.Start();
r.ServerRun(true);
f.Stop();
}
r.ServerStop();
r.Dispose();
}
示例4: ServerMain
static void ServerMain(string[] args)
{
Root r = new Root(args, true);
r.ServerServer(args);
r.NextIndex += 10;
while (!Root.Instance.Quit)
{
Flow f = new SpaceWar2006.Flows.GameServer();
r.CurrentFlow = f;
f.Start();
r.ServerRun(true);
f.Stop();
}
r.ServerStop();
r.Dispose();
}
示例5: ClientMain
public static void ClientMain(string[] args)
{
Root r = new Root(args, false);
r.ClientClient(args);
IUserInterface ui = r.UserInterface;
Mod.Instance.Init();
int i;
Flow f;
if ((i = Array.FindIndex<string>(Root.Instance.Args, new Predicate<string>(delegate(string s) { return s == "-connect"; }))) != -1)
{
string host = Root.Instance.Args[i + 1];
f = new PhysicsClient(false);
r.Scene.Clear();
r.ClientConnect(host);
}
else
{
Root.Instance.IsAuthoritive = true;
f = new PhysicsClient(true);
}
r.CurrentFlow = f;
f.Start();
r.ClientLoop();
r.Dispose();
}