Ejemplo n.º 1
0
 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();
 }
Ejemplo n.º 2
0
        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;
        }