Ejemplo n.º 1
0
        public static void EquipEquipment(ICharacter character, IBuyableEquipment equipment)
        {
            if (CanEquipEquipment(character, equipment))
            {
                character.CharacterEquipment.Add(equipment);
                foreach (var s in equipment.Slots)
                {
                    character.Slots.Find(sf => sf.SlotFree && sf.SlotType == s.SlotType).SetSlotFree(false, equipment.Name);
                }
                ((EquipmentBase)equipment).Modifiers.ForEach(character.AddModifier);

                character.SetAttributes();
            }
            else
            {
                throw new Exception();
            }
        }