private static void StealingRichies(string[] safeContent, Bag myBag) { for (int i = 0; i < safeContent.Length; i += 2) { string name = safeContent[i]; long count = long.Parse(safeContent[i + 1]); string material = myBag.CheckMaterial(name, count); if (material == "") { continue; } myBag.PutRiches(material, name, count); } }