public bool Configure(PlotColor color, string script, SwarmGame sg) { string transaction; m_color = color; m_sg = sg; m_sg.Configure(color, script, out transaction); MainWindow.PostMessage(color, transaction); return(true); }
public MainWindow() { InitializeComponent(); // startup swarm game m_swarmGame = new SwarmGame(); // data m_scripts = new string[(int)PlotColor.Yellow + 1]; Loaded += On_Loaded; Closed += On_Closed; }
private void StartPlayer(PlotColor color, SwarmGame swarmGame) { Thread thread; SwarmWorker sw; // create the worker thread sw = new SwarmWorker(); sw.Configure(color, m_scripts[(int)color], swarmGame); // kick off the thread thread = new Thread(new ThreadStart(sw.RunGame)); thread.Start(); }