Esempio n. 1
0
 public TempMechanicInfo(TempMechanicInfoSave save)
 {
     this.Id          = save.id;
     this.GeneratorId = save.generatorId;
     //this.Count = save.count;
     this.Interval     = 10.0f;//save.interval;
     this.State        = save.state;
     this.timer        = save.timer;
     this.totalTimer   = save.totalTimer;
     this.WorkInterval = save.workInterval;
     this.workTimer    = save.workTimer;
 }
Esempio n. 2
0
        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)
            });
        }