protected override void Attach() { using (m_lock.AcquireExclusiveUsing()) { try { if (MyAPIGateway.Utilities.FileExistsInWorldStorage(DatabaseFile, typeof(BuildingDatabase))) { m_root = null; using (var reader = MyAPIGateway.Utilities.ReadFileInWorldStorage(DatabaseFile, typeof(BuildingDatabase))) { m_root = MyAPIGateway.Utilities.SerializeFromXML <Ob_BuildingDatabase_Root>(reader .ReadToEnd()); } } } catch { // ignore } if (m_root == null) { m_root = new Ob_BuildingDatabase_Root(); } } }
public BuildingDatabase() { m_root = new Ob_BuildingDatabase_Root(); }