public void Adventures_Load() { string filepath = GeneralControl.directory + "\\奇遇"; DirectoryInfo root = new DirectoryInfo(filepath); foreach (FileInfo file in root.GetFiles()) { string json = File.ReadAllText(file.FullName); Adventure adventure = JsonConvert.DeserializeObject <Adventure>(json); adventure.Add_To_General(); } }
private void Button_Click_1(object sender, RoutedEventArgs e) { Adventure adventure = new Adventure { Hp = 10, Mp = 20, Probability = 30 }; adventure.Name = "新奇遇"; adventure.Save(); adventure.Add_To_General(); Add_Adventure(adventure); }
private void Button_Click_1(object sender, RoutedEventArgs e) { Adventure adventure = new Adventure { Attack = 10, Direct_Mp = 10, Cure = 10, Self_Mp = 20, Probability = 30 }; adventure.UserName = GeneralControl.Menu_Person_Information_Class.Instance.User.UserName; adventure.Name = "新奇遇"; adventure.Save(); adventure.Add_To_General(); Add_Adventure(adventure); }