コード例 #1
0
 /// <summary>Initializes a new Trigger</summary>
 /// <param name="parent">The <see cref="Goal"/> to which this object belongs.</param>
 /// <remarks>Trigger set to <b>10</b>, "never (FALSE)".</remarks>
 public Trigger(Goal parent)
 {
     _owner = parent;
     GoalTrigger = new Mission.Trigger();
     GoalTrigger.Condition = 10;
     for (int i = 0; i < 3; i++) _strings[i] = "";
 }
コード例 #2
0
 /// <summary>Initializes a new FlightGroup</summary>
 /// <remarks>All <see cref="Orders"/> set to <b>100%</b> <see cref="BaseFlightGroup.BaseOrder.Throttle"/>, <see cref="Goals"/> are all set to <b>NONE</b>, SP1 <b>Enabled</b>, <see cref="Unknowns"/> are <b>0/false</b></remarks>
 public FlightGroup()
 {
     _stringLength = 0x14;
     for (int i = 0; i < Orders.Length; i++)
     {
         Orders[i] = new Order();
     }
     for (int i = 0; i < _roles.Length; i++)
     {
         _roles[i] = "";
     }
     for (int i = 0; i < ArrDepTriggers.Length; i++)
     {
         ArrDepTriggers[i] = new Mission.Trigger();
     }
     for (int i = 0; i < SkipToOrder4Trigger.Length; i++)
     {
         SkipToOrder4Trigger[i] = new Mission.Trigger();
     }                                                                                                                     //[JB] Removed setting skip trigger condition to False by default. LEC missions use True for empty conditions.
     for (int i = 0; i < Goals.Length; i++)
     {
         Goals[i] = new Goal();
     }
     _optLoad[0]  = true;
     _optLoad[9]  = true; //[JB] Adjusted these indexes for added Ion Pulse, Energy Beam, Cluster Mine
     _optLoad[14] = true;
     for (int i = 0; i < Waypoints.Length; i++)
     {
         Waypoints[i] = new Waypoint();
     }
     Waypoints[(int)WaypointIndex.Start1].Enabled = true;
     Roles      = new Indexer <string>(_roles, 4);
     OptLoadout = new LoadoutIndexer(_optLoad);
 }
コード例 #3
0
 /// <summary>Initializes a new FlightGroup</summary>
 /// <remarks>All <see cref="Orders"/> set to <b>100%</b> <see cref="BaseFlightGroup.BaseOrder.Throttle"/>, <see cref="Goals"/> are all set to <b>NONE</b>, SP1 <b>Enabled</b>, <see cref="Unknowns"/> are <b>0/false</b></remarks>
 public FlightGroup()
 {
     _stringLength = 0x14;
     for (int i = 0; i < _orders.Length; i++)
     {
         _orders[i] = new Order();
     }
     for (int i = 0; i < _roles.Length; i++)
     {
         _roles[i] = "";
     }
     for (int i = 0; i < _arrDepTriggers.Length; i++)
     {
         _arrDepTriggers[i] = new Mission.Trigger();
     }
     for (int i = 0; i < _skipToOrder4Trigger.Length; i++)
     {
         _skipToOrder4Trigger[i] = new Mission.Trigger(); _skipToOrder4Trigger[i].Condition = 10;
     }
     for (int i = 0; i < _goals.Length; i++)
     {
         _goals[i] = new Goal();
     }
     _optLoad[0]  = true;
     _optLoad[8]  = true;
     _optLoad[12] = true;
     for (int i = 0; i < _waypoints.Length; i++)
     {
         _waypoints[i] = new Waypoint();
     }
     _waypoints[(int)WaypointIndex.Start1].Enabled = true;
     _rolesIndexer   = new Indexer <string>(_roles, 4);
     _loadoutIndexer = new LoadoutIndexer(_optLoad);
 }
コード例 #4
0
 /// <summary>Creates a new Message object</summary>
 public Message()
 {
     for (int i = 0; i < 4; i++)
     {
         Triggers[i] = new Mission.Trigger();
     }
     SentToTeam[0] = true;
 }
コード例 #5
0
 /// <summary>Initializes a new Trigger</summary>
 /// <param name="parent">The <see cref="Goal"/> to which this object belongs.</param>
 /// <remarks>Trigger set to <b>10</b>, "never (FALSE)".</remarks>
 public Trigger(Goal parent)
 {
     _owner                = parent;
     GoalTrigger           = new Mission.Trigger();
     GoalTrigger.Condition = 10;
     for (int i = 0; i < 3; i++)
     {
         _strings[i] = "";
     }
 }
コード例 #6
0
ファイル: FlightGroup.cs プロジェクト: MikeG621/Platform
 /// <summary>Initializes a new FlightGroup</summary>
 /// <remarks>All <see cref="Orders"/> set to <b>100%</b> <see cref="BaseFlightGroup.BaseOrder.Throttle"/>, <see cref="Goals"/> are all set to <b>NONE</b>, SP1 <b>Enabled</b>, <see cref="Unknowns"/> are <b>0/false</b></remarks>
 public FlightGroup()
 {
     _stringLength = 0x14;
     for (int i = 0; i < _orders.Length; i++) _orders[i] = new Order();
     for (int i = 0; i < _roles.Length; i++) _roles[i] = "";
     for (int i = 0; i < _arrDepTriggers.Length; i++) _arrDepTriggers[i] = new Mission.Trigger();
     for (int i = 0; i < _skipToOrder4Trigger.Length; i++) { _skipToOrder4Trigger[i] = new Mission.Trigger(); _skipToOrder4Trigger[i].Condition = 10; }
     for (int i = 0; i < _goals.Length; i++) _goals[i] = new Goal();
     _optLoad[0] = true;
     _optLoad[8] = true;
     _optLoad[12] = true;
     for (int i = 0; i < _waypoints.Length; i++) _waypoints[i] = new Waypoint();
     _waypoints[(int)WaypointIndex.Start1].Enabled = true;
     _rolesIndexer = new Indexer<string>(_roles, 4);
     _loadoutIndexer = new LoadoutIndexer(_optLoad);
 }
コード例 #7
0
        /// <summary>Changes all Flight Group indexes, to be used during a FG Swap (Move) or Delete operation.</summary>
        /// <remarks>FG references may exist in other mission properties, ensure those properties are adjusted too.</remarks>
        /// <param name="srcIndex">The FG index to match and replace (Move), or match and Delete.</param>
        /// <param name="dstIndex">The FG index to replace with.  Specify -1 to Delete, or zero or above to Move.</param>
        /// <returns>True if something was changed.</returns>
        public bool TransformFGReferences(int srcIndex, int dstIndex)
        {
            bool change = false;
            bool delete = false;
            byte dst    = (byte)dstIndex;

            if (dstIndex < 0)
            {
                dst    = 0;
                delete = true;
            }

            //If the FG matches, replace (and delete if necessary).  Else if our index is higher and we're supposed to delete, decrement index.
            if (ArrivalCraft1 == srcIndex)
            {
                change = true; ArrivalCraft1 = dst; if (delete)
                {
                    ArrivalMethod1 = false;
                }
            }
            else if (ArrivalCraft1 > srcIndex && delete == true)
            {
                change = true; ArrivalCraft1--;
            }
            if (ArrivalCraft2 == srcIndex)
            {
                change = true; ArrivalCraft2 = dst; if (delete)
                {
                    ArrivalMethod2 = false;
                }
            }
            else if (ArrivalCraft2 > srcIndex && delete == true)
            {
                change = true; ArrivalCraft2--;
            }
            if (DepartureCraft1 == srcIndex)
            {
                change = true; DepartureCraft1 = dst; if (delete)
                {
                    DepartureMethod1 = false;
                }
            }
            else if (DepartureCraft1 > srcIndex && delete == true)
            {
                change = true; DepartureCraft1--;
            }
            if (DepartureCraft2 == srcIndex)
            {
                change = true; DepartureCraft2 = dst; if (delete)
                {
                    DepartureMethod2 = false;
                }
            }
            else if (DepartureCraft2 > srcIndex && delete == true)
            {
                change = true; DepartureCraft2--;
            }
            for (int i = 0; i < ArrDepTriggers.Length; i++)
            {
                Mission.Trigger adt = ArrDepTriggers[i];
                change |= adt.TransformFGReferences(srcIndex, dstIndex, true);  //First 2 are arrival.  Set those to true.
            }
            foreach (Mission.Trigger trig in SkipToOrder4Trigger)
            {
                change |= trig.TransformFGReferences(srcIndex, dstIndex, true);
            }

            foreach (FlightGroup.Order order in Orders)
            {
                change |= order.TransformFGReferences(srcIndex, dstIndex);
            }

            return(change);
        }
コード例 #8
0
ファイル: Message.cs プロジェクト: MikeG621/Platform
 /// <summary>Creates a new Message object</summary>
 public Message()
 {
     for (int i = 0; i < 4; i++) _triggers[i] = new Mission.Trigger();
     _sentToTeam[0] = true;
 }