public static void with <T>(Action <T> proc) where T : GameObj { var typeName = typeof(T).Name; foreach (var item in GameObj.AllOf(typeName)) { proc((T)item); } }