using System.Collections.Generic;
public class ThingWithStackable
public int stackable { get; set; }
public string shortname { get; set; }
public ThingWithStackable( string shortname )
this.shortname = shortname;
public static List<ThingWithStackable> ItemManagerItemList = new List<ThingWithStackable>()
new ThingWithStackable("item1"),
new ThingWithStackable("item2"),
new ThingWithStackable("item3")
List<string> item_ores = new List<string>(new string[] { "item1", "item2", "item3" });
private void setStack(List<string> items, int limit) {
foreach (string itemName in items) {
ItemManagerItemList.First(x => x.shortname == itemName).stackable = limit;
setStack(item_ores, 50000);
public static void Main()
foreach (var item in ItemManagerItemList)
Console.WriteLine(item.shortname + " " + item.stackable);