public void InitializeRenderFactory() { try { resini = File.ReadAllText("res.ini"); if (resini == "High") { Console.WriteLine("Got resolution from res.ini"); Console.WriteLine("Resolution set to high"); renderFactory = new HighResRenderFactory(); } else if (resini == "Low") { Console.WriteLine("Got resolution from res.ini"); Console.WriteLine("Resolution set to low"); renderFactory = new LowResRenderFactory(); } else { Console.WriteLine("res.ini file should read either High or Low. Setting resolution to low by default"); renderFactory = new LowResRenderFactory(); } } catch (System.IO.FileNotFoundException) { Console.WriteLine("res.ini file not found. Setting resolution to low by default"); renderFactory = new LowResRenderFactory(); } }
public RendererFactory(IRenderFactory renderFactory) { this.renderFactory = renderFactory; }