public void Init() { var serializer = new XmlSerializer(typeof(GameEngine)); using (var reader = new StreamReader(Resources.XmlFileName)) { try { var result = serializer.Deserialize(reader) as GameEngine; if (result != null) { Engine = result; } else { System.Console.WriteLine("Failed initializing data from XML"); } } catch (System.Exception ex) { System.Console.WriteLine("Failed initializing data from xml with exception:\n " + ex.Message); } } }
public void Dispose() { _engine = null; }