public void KarvoniteOut(string filename) { ObjectSpace objectSpace = new ObjectSpace("MapModel.kvtmodel,Paradux", filename); objectSpace.CreateObjectLibrary(true); // Open ObjectSpace (empty up to this point) objectSpace.Open(); objectSpace.Add(this); // Ensures changes objectSpace.Save(); objectSpace.Close(); }
public bool KarvoniteIn(string filename) { AppFramework.PhysicsSimulator.Clear(); ObjectSpace objectSpace = new ObjectSpace("MapModel.kvtmodel,Paradux", filename); Map newMap = null; try { objectSpace.Open(); newMap = objectSpace.GetFirstObject<Map>(); } catch (System.Exception) { return false; } finally { objectSpace.Close(); } if (newMap == null) return false; LoadMap(newMap); return true; }