Ejemplo n.º 1
0
        //load sector
        private void loadToolStripMenuItem_Click_1(object sender, EventArgs e)
        {
            string file = Path.Combine(this.saves_path, SectorTree.SelectedNode.Text, "SANDBOX_0_0_0_.sbs");

            if (File.Exists(file))
            {
                Sandbox.Common.ObjectBuilders.MyObjectBuilder_Base sec = Sandbox.Common.ObjectBuilders.MyObjectBuilder_Base.CreateNewObject(Sandbox.Common.ObjectBuilders.MyObjectBuilderTypeEnum.Sector);
                MyObjectBuilder_Sector mySector = (Sandbox.Common.ObjectBuilders.MyObjectBuilder_Sector)sec;
                Console.WriteLine(mySector.Position.ToString());
                try
                {
                    using (FileStream sr = File.Open(file, FileMode.Open))
                    {
                        if (Sandbox.Common.ObjectBuilders.MyObjectBuilder_Base.DeserializeXML(sr, out mySector))
                        {
                            this.create_tree(SectorTree.SelectedNode, mySector);
                        }
                    }
                }
                catch (System.NullReferenceException)
                {
                    MessageBox.Show("Unable to load that savegame, please report this!");
                }
            }
        }
Ejemplo n.º 2
0
 public static MyDefinitionId GetId(this MyObjectBuilder_Base self)
 {
     return(new MyDefinitionId(self.TypeId, self.SubtypeId));
 }
Ejemplo n.º 3
0
		private static void SaveSandbox( MyObjectBuilder_Base objectBuilder, string savePath, out ulong fileSize )
		{
			string path = Path.Combine(savePath, "Sandbox.sbc");
			MyObjectBuilderSerializer.SerializeXML(path, false, objectBuilder, out fileSize);
		}
 public static MyGuiControlBase CreateGuiControl(MyObjectBuilder_Base builder)
 {
     return m_objectFactory.CreateInstance(builder.TypeId);
 }
Ejemplo n.º 5
0
 void SwitchToWeaponSuccess(MyDefinitionId? weapon, MyObjectBuilder_Base weaponObjectBuilder, long weaponEntityId)
 {
     SwitchToWeaponInternal(weapon, false);
 }