Exemple #1
0
        public override object GetSave()
        {
            Dictionary <int, Dictionary <string, AuditorSave> > auditorSaves = new Dictionary <int, Dictionary <string, AuditorSave> >();

            foreach (var kvp in Auditors)
            {
                if (kvp.Value.Count > 0)
                {
                    Dictionary <string, AuditorSave> generatorAuditors = new Dictionary <string, AuditorSave>();
                    foreach (var kvp2 in kvp.Value)
                    {
                        AuditorSave saveObj = kvp2.Value.GetSave();
                        generatorAuditors.Add(saveObj.id, saveObj);
                    }
                    auditorSaves.Add(kvp.Key, generatorAuditors);
                }
            }
            return(new AuditorServiceSave {
                auditors = auditorSaves,
                speedMults = SpeedMults.ToDictionary(kvp => kvp.Key, kvp => kvp.Value)
            });
        }
        public override object GetSave()
        {
            Dictionary <int, Dictionary <string, TempMechanicInfoSave> > tempMechanicInfoSaves =
                new Dictionary <int, Dictionary <string, TempMechanicInfoSave> >();

            foreach (var kvp in TempMechanics)
            {
                if (kvp.Value.Count > 0)
                {
                    Dictionary <string, TempMechanicInfoSave> generatorMechanics = new Dictionary <string, TempMechanicInfoSave>();
                    foreach (var kvp2 in kvp.Value)
                    {
                        TempMechanicInfoSave saveObj = kvp2.Value.GetSave();
                        generatorMechanics.Add(saveObj.id, saveObj);
                    }
                    tempMechanicInfoSaves.Add(kvp.Key, generatorMechanics);
                }
            }
            return(new TempMechanicServiceSave {
                tempMechanics = tempMechanicInfoSaves,
                speedMults = SpeedMults.ToDictionary(kvp => kvp.Key, kvp => kvp.Value)
            });
        }