Esempio n. 1
0
        public void SpecialistDtoToSpecialistShouldPass()
        {
            var specialistInstanceDto = new SpecialistInstanceDto();
            var specialistInstance    = _mapper.Map <SpecialistInstance>(specialistInstanceDto);

            Assert.IsNotNull(specialistInstance);
        }
Esempio n. 2
0
        public void SpecialistDtoToSpecialistShouldPass()
        {
            var specialistInstanceDto = new SpecialistInstanceDto();
            var specialistInstance    = specialistInstanceDto.Adapt <SpecialistInstance>();

            Assert.IsNotNull(specialistInstance);
        }
        public IItemInstance Convert(IItemInstanceDto k)
        {
            IItemInstance item = k switch
            {
                BoxInstanceDto _ => k.Adapt <BoxInstance>(),
                SpecialistInstanceDto _ => k.Adapt <SpecialistInstance>(),
                WearableInstanceDto _ => k.Adapt <WearableInstance>(),
                UsableInstanceDto _ => k.Adapt <UsableInstance>(),
                _ => k.Adapt <ItemInstance>()
            };

            item.Item = _items.Find(s => s.VNum == k.ItemVNum)?.Adapt <Item.Item>();
            if (item.Item != null)
            {
                _runner?.LoadHandlers(item.Item);
            }

            return(item);
        }