Beispiel #1
0
        private ItemData LoadItem(ItemSeeker seeker)
        {
            ItemData result;

            switch (seeker.ItemType)
            {
            case ItemTypeIndex.Enemy:
                result = new ItemEnemyData();
                break;

            case ItemTypeIndex.PowerUp:
                result = new ItemPowerupData();
                break;

            case ItemTypeIndex.Mella:
            case ItemTypeIndex.Rinkas:
            case ItemTypeIndex.MotherBrain:
            case ItemTypeIndex.PalSwap:
            case ItemTypeIndex.Zebetite:
                result = new ItemSingleByteData();
                break;

            case ItemTypeIndex.Elevator:
                result = new ItemElevatorData();
                break;

            case ItemTypeIndex.Turret:
                result = new ItemTurretData();
                break;

            case ItemTypeIndex.Door:
                result = new ItemDoorData();
                break;

            case ItemTypeIndex.Nothing:
            case ItemTypeIndex.Unused_b:
            case ItemTypeIndex.Unused_c:
            case ItemTypeIndex.Unused_d:
            case ItemTypeIndex.Unused_e:
            case ItemTypeIndex.Unused_f:
            default:
                return(null);
            }

            result.LoadData(seeker);
            return(result);
        }