void Start() { StreamReader reader = new StreamReader(@"X:\TLRPGdata\Enemies\Enemies.txt"); string s = reader.ReadLine(); string[] data; while (s != null) //Load enemies { data = s.Split('~'); Enemy e = new Enemy(); e.name = data[0]; e.id = data[1]; e.hp = CommandsLoadSave.IntParseFast(data[2]); e.atk = CommandsLoadSave.IntParseFast(data [3]); e.atk = CommandsLoadSave.IntParseFast(data [4]); s = reader.ReadLine(); data = s.Split('~'); var i = 0; while (i != data.Length) { e.loot.Add(data [i]); i++; } EnemyStructs.Add(e); EnemyIds.Add(e.id); s = reader.ReadLine(); s = reader.ReadLine(); } }
void Start() { StreamReader reader = new StreamReader(@"X:\TLRPGdata\Items\EquipsHats.txt"); string s = reader.ReadLine(); string[] data; while (s != null) { data = s.Split('~'); Equip e = new Equip(); e.name = data[0]; e.id = data[1]; e.sellPrice = CommandsLoadSave.IntParseFast(data[2]); e.slot = 0; s = reader.ReadLine(); data = s.Split('~'); e.stats[0] = CommandsLoadSave.IntParseFast(data[0]); e.stats[1] = CommandsLoadSave.IntParseFast(data[1]); e.stats[2] = CommandsLoadSave.IntParseFast(data[2]); e.stats[3] = CommandsLoadSave.IntParseFast(data[3]); e.stats[4] = CommandsLoadSave.IntParseFast(data[4]); EquipStructs.Add(e); EquipIds.Add(e.id); s = reader.ReadLine(); s = reader.ReadLine(); } reader = new StreamReader(@"X:\TLRPGdata\Items\EquipsBods.txt"); s = reader.ReadLine(); while (s != null) { data = s.Split('~'); Equip e = new Equip(); e.name = data[0]; e.id = data[1]; e.sellPrice = CommandsLoadSave.IntParseFast(data[2]); e.slot = 1; s = reader.ReadLine(); data = s.Split('~'); e.stats[0] = CommandsLoadSave.IntParseFast(data[0]); e.stats[1] = CommandsLoadSave.IntParseFast(data[1]); e.stats[2] = CommandsLoadSave.IntParseFast(data[2]); e.stats[3] = CommandsLoadSave.IntParseFast(data[3]); e.stats[4] = CommandsLoadSave.IntParseFast(data[4]); EquipStructs.Add(e); EquipIds.Add(e.id); s = reader.ReadLine(); s = reader.ReadLine(); } reader = new StreamReader(@"X:\TLRPGdata\Items\EquipsWeps.txt"); s = reader.ReadLine(); while (s != null) { data = s.Split('~'); Equip e = new Equip(); e.name = data[0]; e.id = data[1]; e.sellPrice = CommandsLoadSave.IntParseFast(data[2]); e.slot = 2; s = reader.ReadLine(); data = s.Split('~'); e.stats[0] = CommandsLoadSave.IntParseFast(data[0]); e.stats[1] = CommandsLoadSave.IntParseFast(data[1]); e.stats[2] = CommandsLoadSave.IntParseFast(data[2]); e.stats[3] = CommandsLoadSave.IntParseFast(data[3]); e.stats[4] = CommandsLoadSave.IntParseFast(data[4]); EquipStructs.Add(e); EquipIds.Add(e.id); s = reader.ReadLine(); s = reader.ReadLine(); } reader = new StreamReader(@"X:\TLRPGdata\Items\EquipsAccs.txt"); s = reader.ReadLine(); while (s != null) { data = s.Split('~'); Equip e = new Equip(); e.name = data[0]; e.id = data[1]; e.sellPrice = CommandsLoadSave.IntParseFast(data[2]); e.slot = 3; s = reader.ReadLine(); data = s.Split('~'); e.stats[0] = CommandsLoadSave.IntParseFast(data[0]); e.stats[1] = CommandsLoadSave.IntParseFast(data[1]); e.stats[2] = CommandsLoadSave.IntParseFast(data[2]); e.stats[3] = CommandsLoadSave.IntParseFast(data[3]); e.stats[4] = CommandsLoadSave.IntParseFast(data[4]); EquipStructs.Add(e); EquipIds.Add(e.id); s = reader.ReadLine(); s = reader.ReadLine(); } reader = new StreamReader(@"X:\TLRPGdata\Items\Resources.txt"); s = reader.ReadLine(); while (s != null) { data = s.Split('~'); Resource r = new Resource(); r.name = data[0]; r.id = data[1]; r.type = data[2]; r.sellPrice = CommandsLoadSave.IntParseFast(data[3]); ResourceStructs.Add(r); ResourceIds.Add(r.id); s = reader.ReadLine(); } reader.Close(); }