Ejemplo n.º 1
0
        public void FromSave(string action)
        {
            OrXchaseTokenReader reader = new OrXchaseTokenReader(action);

            string sType     = reader.NextTokenEnd(',');
            string sDelay    = reader.NextTokenEnd(',');
            string sPosition = reader.NextToken('[', ']');

            type     = (PatrolActionType)Enum.Parse(typeof(PatrolActionType), sType);
            delay    = int.Parse(sDelay);
            position = Util.ParseVector3d(sPosition, false);
        }
Ejemplo n.º 2
0
        public void FromSave(string patrol)
        {
            try
            {
                //OrXchaseDebug.DebugWarning("Patrol.FromSave()");
                OrXchaseTokenReader reader = new OrXchaseTokenReader(patrol);

                string sAllowRunning       = reader.NextTokenEnd(',');
                string sCurrentPatrolPoint = reader.NextTokenEnd(',');
                string sReferenceBody      = reader.NextTokenEnd(',');
                string sPointlist          = reader.NextToken('{', '}');

                AllowRunning       = bool.Parse(sAllowRunning);
                currentPatrolPoint = int.Parse(sCurrentPatrolPoint);
                referenceBody      = sReferenceBody;

                actions.Clear();

                if (!string.IsNullOrEmpty(sPointlist))
                {
                    reader = new OrXchaseTokenReader(sPointlist);

                    while (!reader.EOF)
                    {
                        PatrolAction action = new PatrolAction();

                        string token = reader.NextToken('(', ')');
                        action.FromSave(token);

                        actions.Add(action);
                    }


                    if (OrXchaseSettings.displayDebugLines)
                    {
                        GenerateLine();
                    }
                }
            }
            catch
            {
                throw new Exception("[OrX Chase] Patrol.FromSave Failed.");
            }
        }
Ejemplo n.º 3
0
        private static Guid GetFlightIDFromEvaString(string evaString)
        {
            OrXchaseTokenReader reader = new OrXchaseTokenReader(evaString);

            string sflightID = reader.NextTokenEnd(',');

            //Load the eva
            Guid flightID = new Guid(sflightID);

            return(flightID);
        }
Ejemplo n.º 4
0
        public void FromSave(string order)
        {
            //OrXchaseDebug.DebugWarning("Order.FromSave()");
            OrXchaseTokenReader reader = new OrXchaseTokenReader(order);

            string sAllowRunning = reader.NextTokenEnd(',');
            string sPosition     = reader.NextToken('[', ']'); reader.Consume(); // ,
            string sOffset       = reader.NextToken('[', ']');

            AllowRunning = bool.Parse(sAllowRunning);
            Position     = Util.ParseVector3d(sPosition, false);
            Offset       = Util.ParseVector3d(sOffset, false);
        }
Ejemplo n.º 5
0
        public void FromSave(string OrXchaseSettings)
        {
            OrXchaseTokenReader reader = new OrXchaseTokenReader(OrXchaseSettings);

            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);

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

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