public PipeClient(string handle, NxSim game) { PipeStream pipeClient = new AnonymousPipeClientStream(PipeDirection.In, handle); sr = new StreamReader(pipeClient); ev = EventWaitHandle.OpenExisting("NxPipe"); this.game = game; }
static void Main(string[] args) { var game = new NxSim(); if (args.Length > 0) { PipeClient pc = new PipeClient(args[0], game); Thread t = new Thread( new ParameterizedThreadStart(pc.Listen) ); t.IsBackground = true; t.Start(); } using (game) game.Run(); }