private static ConstructionInformation LoadConstructionInformation(XmlReader reader)
        {
            float constructionTime = Convert.ToSingle(reader["ConstructionTime"], CultureInfo.InvariantCulture);
            List <ResourceTypeSource> resources           = new List <ResourceTypeSource>();
            EnvironmentResource       environmentResource = new EnvironmentResource();

            do
            {
                reader.Read();
                reader.MoveToContent();
                if (reader.Name == nameof(EnvironmentResource))
                {
                    int winStep = Convert.ToInt32(reader["WinStep"] ?? "0", CultureInfo.InvariantCulture);
                    int o2      = Convert.ToInt32(reader["O2"] ?? "0", CultureInfo.InvariantCulture);
                    int energy  = Convert.ToInt32(reader["Energy"] ?? "0", CultureInfo.InvariantCulture);
                    environmentResource = new EnvironmentResource(winStep, o2, energy);
                }
                else if (reader.NodeType == XmlNodeType.Element)
                {
                    var  resourceName       = reader.Name;
                    bool fromHexagon        = Convert.ToBoolean(reader["FromHexagon"] ?? "False", CultureInfo.InvariantCulture);
                    var  resourceType       = (ResourceType)Enum.Parse(typeof(ResourceType), resourceName);
                    var  resourceTypeSource = new ResourceTypeSource(resourceType, fromHexagon ? SourceType.Hexagon : SourceType.Network);
                    resources.Add(resourceTypeSource);
                }
            }while (reader.IsStartElement() || reader.Name != "ConstructionInformation");
            var constructionInformation = new ConstructionInformation(constructionTime, environmentResource, resources.ToArray());

            return(constructionInformation);
        }
        private static ProductionInformation LoadProductionInformation(XmlReader reader)
        {
            float productionTime = Convert.ToSingle(reader[nameof(ProductionInformation.ProductionTime)], CultureInfo.InvariantCulture);
            List <ResourceTypeSource> ingredients = new List <ResourceTypeSource>();
            List <ResourceTypeSource> products    = new List <ResourceTypeSource>();
            EnvironmentResource       ingredientEnvironmentResource = new EnvironmentResource();
            EnvironmentResource       productsEnvironmentResource   = new EnvironmentResource();
            Knowledge producedKnowledge = Knowledge.Zero;

            do
            {
                reader.Read();

                if (reader.IsStartElement(nameof(ProductionInformation.Ingredients)))
                {
                    reader.Read();
                    reader.MoveToContent();
                    do
                    {
                        if (reader.Name == nameof(EnvironmentResource))
                        {
                            int winStep = Convert.ToInt32(reader["WinStep"] ?? "0", CultureInfo.InvariantCulture);
                            int o2      = Convert.ToInt32(reader["O2"] ?? "0", CultureInfo.InvariantCulture);
                            int energy  = Convert.ToInt32(reader["Energy"] ?? "0", CultureInfo.InvariantCulture);
                            ingredientEnvironmentResource = new EnvironmentResource(winStep, o2, energy);
                        }
                        else
                        {
                            var  resourceName       = reader.Name;
                            bool fromHexagon        = reader["Source"] == "Hexagon";
                            var  resourceType       = (ResourceType)Enum.Parse(typeof(ResourceType), resourceName);
                            var  resourceTypeSource = new ResourceTypeSource(resourceType, fromHexagon ? SourceType.Hexagon : SourceType.Network);
                            ingredients.Add(resourceTypeSource);
                        }
                        reader.Read();
                        reader.MoveToContent();
                    }while (reader.IsStartElement() || reader.Name != nameof(ProductionInformation.Ingredients));
                }
                else if (reader.IsStartElement(nameof(ProductionInformation.Products)))
                {
                    reader.Read();
                    reader.MoveToContent();
                    do
                    {
                        if (reader.Name == nameof(EnvironmentResource))
                        {
                            int winStep = Convert.ToInt32(reader["WinStep"] ?? "0", CultureInfo.InvariantCulture);
                            int o2      = Convert.ToInt32(reader["O2"] ?? "0", CultureInfo.InvariantCulture);
                            int energy  = Convert.ToInt32(reader["Energy"] ?? "0", CultureInfo.InvariantCulture);
                            productsEnvironmentResource = new EnvironmentResource(winStep, o2, energy);
                        }
                        else if (reader.Name == nameof(Knowledge))
                        {
                            int k1 = Convert.ToInt32(reader[nameof(Knowledge.Knowledge1)] ?? "0", CultureInfo.InvariantCulture);
                            int k2 = Convert.ToInt32(reader[nameof(Knowledge.Knowledge2)] ?? "0", CultureInfo.InvariantCulture);
                            int k3 = Convert.ToInt32(reader[nameof(Knowledge.Knowledge3)] ?? "0", CultureInfo.InvariantCulture);
                            producedKnowledge = new Knowledge(k1, k2, k3);
                        }
                        else
                        {
                            var  resourceName       = reader.Name;
                            bool fromHexagon        = Convert.ToBoolean(reader["FromHexagon"] ?? "False", CultureInfo.InvariantCulture);
                            var  resourceType       = (ResourceType)Enum.Parse(typeof(ResourceType), resourceName);
                            var  resourceTypeSource = new ResourceTypeSource(resourceType, fromHexagon ? SourceType.Hexagon : SourceType.Network);
                            products.Add(resourceTypeSource);
                        }
                        reader.Read();
                        reader.MoveToContent();
                    }while (reader.IsStartElement() || reader.Name != nameof(ProductionInformation.Products));
                }
            }while (reader.IsStartElement() || reader.Name != nameof(ProductionInformation));
            var productionInformation = new ProductionInformation(new IngredientsCollection(ingredientEnvironmentResource, ingredients.ToArray()), new ProductsCollection(productsEnvironmentResource, producedKnowledge, products.ToArray()), productionTime);

            return(productionInformation);
        }