public static CharacterSet TestCharSet() { CharacterSet ac = new CharacterSet(); foreach (var m in TestMobs()) { ac.AddMonsters(m, 1); } CharData c = new CharData("Name", "_Name", 6, 6); ac.AddCharacter(c); return(ac); }
private static CharacterSet CharactersloaderV1(StreamReader rdr, string[] check) { CharacterSet cs = new CharacterSet(); while (rdr.EndOfStream == false) { string line = rdr.ReadLine(); var seperators = line.Split(','); // File Structure = NAME,PlayerName, EpicDex, JoinBattle CharData c = new CharData(seperators[0], seperators[1], Convert.ToInt16(seperators[3]), Convert.ToInt16(seperators[2])); cs.AddCharacter(c); } return(cs); }
/// <summary> /// Save Character Files, extracted from current character set, /// </summary> /// <param name="filepath"></param> /// <param name="cs"></param> public static void CharacterSaver(string filepath, CharacterSet cs) { IsolatedStorageFile isoStore = IsolatedStorageFile.GetStore(IsolatedStorageScope.User | IsolatedStorageScope.Assembly, null, null); using (IsolatedStorageFileStream fileStream = new IsolatedStorageFileStream(filepath, FileMode.OpenOrCreate, FileAccess.ReadWrite)) { using (StreamWriter Wtr = new StreamWriter(fileStream)) { Wtr.WriteLine("Version:1,Players"); foreach (CharData C in cs.ActiveCharacters()) { Wtr.WriteLine(C.PlayerName + "," + C.ToonName + "," + C.epicDex + "," + C.joinBattle); } } } }