Beispiel #1
0
        internal static void AddItem(this GameSave gameSave, Level level, ItemIdentifier itemInfo)
        {
            switch (itemInfo.LootType)
            {
            case LootType.ConstOrb:
                gameSave.AddOrb(itemInfo.OrbType, itemInfo.OrbSlot);
                break;

            case LootType.ConstEquipment:
                gameSave.AddEquipment(itemInfo.Equipment);
                break;

            case LootType.ConstUseItem:
                gameSave.AddUseItem(itemInfo.UseItem);
                break;

            case LootType.ConstRelic:
                gameSave.AddRelic(itemInfo.Relic);
                break;

            case LootType.ConstFamiliar:
                gameSave.AddFamiliar(itemInfo.Familiar);
                break;

            case LootType.ConstStat:
                gameSave.AddStat(level, itemInfo.Stat);
                break;

            default:
                throw new ArgumentOutOfRangeException($"LootType {itemInfo.LootType} isnt suppored yet");
            }
        }