public HumanPerson Restore(ISchemeService schemeService,
                                   ISurvivalRandomSource survivalRandomSource,
                                   IPropFactory propFactory)
        {
            if (schemeService is null)
            {
                throw new ArgumentNullException(nameof(schemeService));
            }

            if (survivalRandomSource is null)
            {
                throw new ArgumentNullException(nameof(survivalRandomSource));
            }

            if (propFactory is null)
            {
                throw new ArgumentNullException(nameof(propFactory));
            }

            var storedPerson = this;

            var personScheme = schemeService.GetScheme <IPersonScheme>("human-person");

            var inventory = new InventoryModule();

            var evolutionData = new EvolutionModule(schemeService);

            RestoreEvolutionData(schemeService, storedPerson, evolutionData);

            var person = new HumanPerson(personScheme);

            //TODO Создать необходимые модули и заполнить их.

            foreach (var survivalStoredItem in storedPerson.Survival)
            {
                var normalizedValueShare = RangeHelper.NormalizeShare(survivalStoredItem.Value);

                var stat = person.GetModule <ISurvivalModule>().Stats.Single(x => x.Type == survivalStoredItem.Type);

                stat.SetShare(normalizedValueShare);
            }

            foreach (var storedProp in storedPerson.Inventory)
            {
                var   propScheme = schemeService.GetScheme <IPropScheme>(storedProp.Sid);
                IProp prop;
                switch (storedProp.Type)
                {
                case PropType.Resource:
                    prop = propFactory.CreateResource(propScheme, storedProp.Count);
                    break;

                case PropType.Equipment:
                    var equipment = propFactory.CreateEquipment(propScheme);
                    equipment.Durable.Value = storedProp.Durable;
                    prop = equipment;

                    break;

                default:
                    throw new Exception();
                }

                inventory.Add(prop);
            }

            for (var i = 0; i < storedPerson.Equipments.Length; i++)
            {
                var storedEquipment = storedPerson.Equipments[i];

                if (storedEquipment == null)
                {
                    continue;
                }

                var equipmentScheme = schemeService.GetScheme <IPropScheme>(storedEquipment.Sid);

                var equipment = propFactory.CreateEquipment(equipmentScheme);
                equipment.Durable.Value = storedEquipment.Durable;

                person.GetModule <IEquipmentModule>()[i] = equipment;
                //TODO Уменьшать прочность согласно сохранённым данным
            }

            return(person);
        }
        public HumanPerson Restore(ISchemeService schemeService,
                                   ISurvivalRandomSource survivalRandomSource,
                                   IPropFactory propFactory)
        {
            var storedPerson = this;

            var personScheme = schemeService.GetScheme <IPersonScheme>("human-person");

            var inventory = new Inventory();

            var evolutionData = new EvolutionData(schemeService);

            RestoreEvolutionData(schemeService, storedPerson, evolutionData);

            var defaultActScheme = schemeService.GetScheme <ITacticalActScheme>(personScheme.DefaultAct);

            var person = new HumanPerson(personScheme,
                                         defaultActScheme,
                                         evolutionData,
                                         survivalRandomSource,
                                         inventory);

            foreach (var survivalStoredItem in storedPerson.Survival)
            {
                var normalizedValueShare = RangeHelper.NormalizeShare(survivalStoredItem.Value);

                var stat = person.Survival.Stats.Single(x => x.Type == survivalStoredItem.Type);

                stat.SetShare(normalizedValueShare);
            }

            foreach (var storedProp in storedPerson.Inventory)
            {
                var   propScheme = schemeService.GetScheme <IPropScheme>(storedProp.Sid);
                IProp prop;
                switch (storedProp.Type)
                {
                case PropType.Resource:
                    prop = propFactory.CreateResource(propScheme, storedProp.Count);
                    break;

                case PropType.Equipment:
                    var equipment = propFactory.CreateEquipment(propScheme);
                    equipment.Durable.Value = storedProp.Durable;
                    prop = equipment;

                    break;

                default:
                    throw new Exception();
                }

                inventory.Add(prop);
            }

            for (var i = 0; i < storedPerson.Equipments.Length; i++)
            {
                var storedEquipment = storedPerson.Equipments[i];

                if (storedEquipment == null)
                {
                    continue;
                }

                var equipmentScheme = schemeService.GetScheme <IPropScheme>(storedEquipment.Sid);

                var equipment = propFactory.CreateEquipment(equipmentScheme);
                equipment.Durable.Value = storedEquipment.Durable;

                person.EquipmentCarrier[i] = equipment;
                //TODO Уменьшать прочность согласно сохранённым данным
            }

            return(person);
        }