Ejemplo n.º 1
0
        internal void FromSave(string evaSettings)
        {
            EvaTokenReader reader = new EvaTokenReader(evaSettings);

            try
            {
                string sflightID  = reader.NextTokenEnd(',');
                string sName      = reader.NextTokenEnd(',');
                string mode       = reader.NextTokenEnd(',');
                string status     = reader.NextTokenEnd(',');
                string selected   = reader.NextTokenEnd(',');
                string showHelmet = reader.NextTokenEnd(',');

                string formation = reader.NextToken('(', ')'); reader.Consume();
                string patrol    = reader.NextToken('(', ')'); reader.Consume();
                string order     = reader.NextToken('(', ')'); reader.Consume();
                string wanderer  = reader.NextToken('(', ')');

                this.Name       = sName;
                this.mode       = (Mode)Enum.Parse(typeof(Mode), mode);
                this.status     = (Status)Enum.Parse(typeof(Status), status);
                this.selected   = bool.Parse(selected);
                this.showHelmet = bool.Parse(showHelmet);


                this.formation.FromSave(formation);
                this.patrol.FromSave(patrol);
                this.order.FromSave(order);
                this.wanderer.FromSave(wanderer);

                EvaDebug.DebugLog("Loaded: " + mode);
                EvaDebug.DebugLog("name: " + sName);
                EvaDebug.DebugLog("status: " + status);
                EvaDebug.DebugLog("selected: " + selected);

                if (this.showHelmet == false)
                {
                    eva.ShowHelmet(this.showHelmet);
                }
            }
            catch
            {
                throw new Exception("[EFX] FromSave Failed.");
            }
        }