public FormDetails() { InitializeComponent(); if (ItemDataManager == null) ItemDataManager = new ItemDataManager(); if (EntityDataManager == null) EntityDataManager = new EntityDataManager(); if (SkillDataManager == null) SkillDataManager = new SkillDataManager(); this.FormClosing += new FormClosingEventHandler(FormDetails_FormClosing); }
public FormDetails() { InitializeComponent(); if (FormDetails.ItemManager == null) { ItemManager = new ItemDataManager(); } if (FormDetails.EntityDataManager == null) { EntityDataManager = new EntityDataManager(); } this.FormClosing += new FormClosingEventHandler(FormDetails_FormClosing); }
public static void ReadItemData() { itemManager = new ItemDataManager(); string[] fileNames = Directory.GetFiles( Path.Combine(FormMain.ItemPath, "Armor"), "*.xml"); foreach (string s in fileNames) { ArmorData armorData = XnaSerializer.Deserialize<ArmorData>(s); itemManager.ArmorData.Add(armorData.Name, armorData); } fileNames = Directory.GetFiles( Path.Combine(FormMain.ItemPath, "Shield"), "*.xml"); foreach (string s in fileNames) { ShieldData shieldData = XnaSerializer.Deserialize<ShieldData>(s); itemManager.ShieldData.Add(shieldData.Name, shieldData); } fileNames = Directory.GetFiles( Path.Combine(FormMain.ItemPath, "Weapon"), "*.xml"); foreach (string s in fileNames) { WeaponData weaponData = XnaSerializer.Deserialize<WeaponData>(s); itemManager.WeaponData.Add(weaponData.Name, weaponData); } }