private static void LoadGameItems(Table table, CFStorage storage)
        {
            for (var i = 0; i < table.Data.NumGameItems; i++)
            {
                var itemName = $"GameItem{i}";
                storage.TryGetStream(itemName, out var itemStream);
                if (itemStream == null)
                {
                    Logger.Warn("Could not find stream {0}, skipping.", itemName);
                    continue;
                }
                var itemData = itemStream.GetData();
                if (itemData.Length < 4)
                {
                    Logger.Warn("Skipping {itemName} because it has size of {itemDataLength}.", itemName, itemData.Length);
                    continue;
                }

                var reader   = new BinaryReader(new MemoryStream(itemData));
                var itemType = reader.ReadInt32();
                switch (itemType)
                {
                case ItemType.Bumper: {
                    var item = new VisualPinball.Engine.VPT.Bumper.Bumper(reader, itemName);
                    table.Bumpers[item.Name] = item;
                    break;
                }

                case ItemType.Decal: {
                    table.Decals.Add(new VisualPinball.Engine.VPT.Decal.Decal(reader, itemName));
                    break;
                }

                case ItemType.DispReel: {
                    var item = new VisualPinball.Engine.VPT.DispReel.DispReel(reader, itemName);
                    table.DispReels[item.Name] = item;
                    break;
                }

                case ItemType.Flasher: {
                    var item = new VisualPinball.Engine.VPT.Flasher.Flasher(reader, itemName);
                    table.Flashers[item.Name] = item;
                    break;
                }

                case ItemType.Flipper: {
                    var item = new VisualPinball.Engine.VPT.Flipper.Flipper(reader, itemName);
                    table.Flippers[item.Name] = item;
                    break;
                }

                case ItemType.Gate: {
                    var item = new VisualPinball.Engine.VPT.Gate.Gate(reader, itemName);
                    table.Gates[item.Name] = item;
                    break;
                }

                case ItemType.HitTarget: {
                    var item = new VisualPinball.Engine.VPT.HitTarget.HitTarget(reader, itemName);
                    table.HitTargets[item.Name] = item;
                    break;
                }

                case ItemType.Kicker: {
                    var item = new VisualPinball.Engine.VPT.Kicker.Kicker(reader, itemName);
                    table.Kickers[item.Name] = item;
                    break;
                }

                case ItemType.Light: {
                    var item = new VisualPinball.Engine.VPT.Light.Light(reader, itemName);
                    table.Lights[item.Name] = item;
                    break;
                }

                case ItemType.LightSeq: {
                    var item = new VisualPinball.Engine.VPT.LightSeq.LightSeq(reader, itemName);
                    table.LightSeqs[item.Name] = item;
                    break;
                }

                case ItemType.Plunger: {
                    var item = new VisualPinball.Engine.VPT.Plunger.Plunger(reader, itemName);
                    table.Plungers[item.Name] = item;
                    break;
                }

                case ItemType.Primitive: {
                    var item = new Primitive.Primitive(reader, itemName);
                    table.Primitives[item.Name] = item;
                    break;
                }

                case ItemType.Ramp: {
                    var item = new Ramp.Ramp(reader, itemName);
                    table.Ramps[item.Name] = item;
                    break;
                }

                case ItemType.Rubber: {
                    var item = new Rubber.Rubber(reader, itemName);
                    table.Rubbers[item.Name] = item;
                    break;
                }

                case ItemType.Spinner: {
                    var item = new Spinner.Spinner(reader, itemName);
                    table.Spinners[item.Name] = item;
                    break;
                }

                case ItemType.Surface: {
                    var item = new Surface.Surface(reader, itemName);
                    table.Surfaces[item.Name] = item;
                    break;
                }

                case ItemType.Textbox: {
                    var item = new TextBox.TextBox(reader, itemName);
                    table.TextBoxes[item.Name] = item;
                    break;
                }

                case ItemType.Timer: {
                    var item = new Timer.Timer(reader, itemName);
                    table.Timers[item.Name] = item;
                    break;
                }

                case ItemType.Trigger: {
                    var item = new Trigger.Trigger(reader, itemName);
                    table.Triggers[item.Name] = item;
                    break;
                }
                }
            }
        }
        private static void LoadGameItems(FileTableContainer tableContainer, CFStorage storage, int count, string storagePrefix)
        {
            for (var i = 0; i < count; i++)
            {
                var itemName = $"{storagePrefix}{i}";
                storage.TryGetStream(itemName, out var itemStream);
                if (itemStream == null)
                {
                    Logger.Warn("Could not find stream {0}, skipping.", itemName);
                    continue;
                }
                var itemData = itemStream.GetData();
                if (itemData.Length < 4)
                {
                    Logger.Warn("Skipping {itemName} because it has size of {itemDataLength}.", itemName, itemData.Length);
                    continue;
                }

                var reader = new BinaryReader(new MemoryStream(itemData));

                // parse to enum
                var iItemType = reader.ReadInt32();
                if (!Enum.IsDefined(typeof(ItemType), iItemType))
                {
                    Logger.Info("Invalid item type " + iItemType);
                    return;
                }

                var itemType = (ItemType)iItemType;
                switch (itemType)
                {
                case ItemType.Bumper: {
                    var item = new VisualPinball.Engine.VPT.Bumper.Bumper(reader, itemName);
                    tableContainer.Add(item);
                    break;
                }

                case ItemType.Decal: {
                    tableContainer.Add(new VisualPinball.Engine.VPT.Decal.Decal(reader, itemName));
                    break;
                }

                case ItemType.DispReel: {
                    var item = new VisualPinball.Engine.VPT.DispReel.DispReel(reader, itemName);
                    tableContainer.Add(item);
                    break;
                }

                case ItemType.Flasher: {
                    var item = new VisualPinball.Engine.VPT.Flasher.Flasher(reader, itemName);
                    tableContainer.Add(item);
                    break;
                }

                case ItemType.Flipper: {
                    var item = new VisualPinball.Engine.VPT.Flipper.Flipper(reader, itemName);
                    tableContainer.Add(item);
                    break;
                }

                case ItemType.Gate: {
                    var item = new VisualPinball.Engine.VPT.Gate.Gate(reader, itemName);
                    tableContainer.Add(item);
                    break;
                }

                case ItemType.HitTarget: {
                    var item = new VisualPinball.Engine.VPT.HitTarget.HitTarget(reader, itemName);
                    tableContainer.Add(item);
                    break;
                }

                case ItemType.Kicker: {
                    var item = new VisualPinball.Engine.VPT.Kicker.Kicker(reader, itemName);
                    tableContainer.Add(item);
                    break;
                }

                case ItemType.Light: {
                    var item = new VisualPinball.Engine.VPT.Light.Light(reader, itemName);
                    tableContainer.Add(item);
                    break;
                }

                case ItemType.LightSeq: {
                    var item = new VisualPinball.Engine.VPT.LightSeq.LightSeq(reader, itemName);
                    tableContainer.Add(item);
                    break;
                }

                case ItemType.Plunger: {
                    var item = new VisualPinball.Engine.VPT.Plunger.Plunger(reader, itemName);
                    tableContainer.Add(item);
                    break;
                }

                case ItemType.Primitive: {
                    var item = new Primitive.Primitive(reader, itemName);
                    tableContainer.Add(item);
                    break;
                }

                case ItemType.Ramp: {
                    var item = new Ramp.Ramp(reader, itemName);
                    tableContainer.Add(item);
                    break;
                }

                case ItemType.Rubber: {
                    var item = new Rubber.Rubber(reader, itemName);
                    tableContainer.Add(item);
                    break;
                }

                case ItemType.Spinner: {
                    var item = new Spinner.Spinner(reader, itemName);
                    tableContainer.Add(item);
                    break;
                }

                case ItemType.Surface: {
                    var item = new Surface.Surface(reader, itemName);
                    tableContainer.Add(item);
                    break;
                }

                case ItemType.TextBox: {
                    var item = new TextBox.TextBox(reader, itemName);
                    tableContainer.Add(item);
                    break;
                }

                case ItemType.Timer: {
                    var item = new Timer.Timer(reader, itemName);
                    tableContainer.Add(item);
                    break;
                }

                case ItemType.Trigger: {
                    var item = new Trigger.Trigger(reader, itemName);
                    tableContainer.Add(item);
                    break;
                }

                case ItemType.Trough: {
                    var item = new Trough.Trough(reader, itemName);
                    tableContainer.Add(item);
                    break;
                }

                case ItemType.MetalWireGuide:
                {
                    var item = new MetalWireGuide.MetalWireGuide(reader, itemName);
                    tableContainer.Add(item);
                    break;
                }
                }
            }
        }