Beispiel #1
0
        public void UpdateTaskGroupType()
        {
            int num1 = 0;
            int num2 = 0;
            int num3 = 0;
            int num4 = 0;
            int num5 = 0;
            int num6 = 0;
            int num7 = 0;

            foreach (Ship ship in this.m_Ships)
            {
                if (ship.IsPolice)
                {
                    ++num1;
                }
                else
                {
                    switch (TaskGroup.GetTaskTypeFromShip(ship))
                    {
                    case TaskGroupType.Passive:
                        ++num4;
                        continue;

                    case TaskGroupType.Civilian:
                        ++num5;
                        continue;

                    case TaskGroupType.Freighter:
                        ++num2;
                        continue;

                    case TaskGroupType.UnArmed:
                        ++num6;
                        continue;

                    case TaskGroupType.PlanetAssault:
                        ++num7;
                        continue;

                    default:
                        ++num3;
                        continue;
                    }
                }
            }
            this.m_Type = num1 <= 0 ? (num2 <= 0 ? (num6 <= 0 ? (!this.m_CommanderAI.IsEncounterCombat ? (num7 <= 0 ? (this.m_Ships.Count != 2 || num3 == this.m_Ships.Count || (num5 == this.m_Ships.Count || num4 == this.m_Ships.Count) ? (num5 <= num4 || num5 <= num3 ? (num3 <= num4 || num3 <= num5 ? TaskGroupType.Passive : (num5 <= num4 || num5 <= num3 / 5 ? TaskGroupType.Aggressive : TaskGroupType.Passive)) : (num3 > num4 ? TaskGroupType.Passive : TaskGroupType.Civilian)) : (num5 > 0 ? TaskGroupType.Passive : TaskGroupType.Aggressive)) : TaskGroupType.PlanetAssault) : TaskGroupType.Aggressive) : TaskGroupType.UnArmed) : TaskGroupType.Freighter) : TaskGroupType.Police;
            if (this.m_Type == TaskGroupType.Passive && (this.m_CommanderAI.GetAIType() == OverallAIType.PIRATE || this.m_CommanderAI.GetAIType() == OverallAIType.SLAVER))
            {
                this.m_Type = TaskGroupType.Aggressive;
            }
            if (this.m_Type == TaskGroupType.Civilian || this.m_Type == TaskGroupType.Freighter || this.m_Type == TaskGroupType.Police)
            {
                this.m_PatrolType = PatrolType.Orbit;
            }
            else
            {
                this.m_PatrolType = PatrolType.Circular;
            }
        }
Beispiel #2
0
 public TaskGroup(App game, CombatAI commandAI)
 {
     this.m_Game                   = game;
     this.m_CommanderAI            = commandAI;
     this.m_Objective              = (TacticalObjective)null;
     this.m_Orders                 = TaskGroupOrders.None;
     this.m_Type                   = TaskGroupType.Aggressive;
     this.m_bIsPlayerOrder         = false;
     this.m_bIsInContactWithEnemy  = false;
     this.m_EnemyGroupInContact    = (EnemyGroup)null;
     this.m_Ships                  = new List <Ship>();
     this.m_Targets                = new List <Ship>();
     this.m_ShipControls           = new List <TaskGroupShipControl>();
     this.m_TargetGroup            = (EnemyGroup)null;
     this.m_TargetTaskGroup        = (TaskGroup)null;
     this.m_PatrolType             = PatrolType.Circular;
     this.m_RequestedObjectiveType = ObjectiveType.NO_OBJECTIVE;
     this.m_NumShipTypes           = new int[14];
     for (int index = 0; index < 14; ++index)
     {
         this.m_NumShipTypes[index] = 0;
     }
     this.m_GroupSpeed = 0.0f;
     this.m_RequestRefreshShipControls = false;
     this.m_ChangeAttackTime           = 4800;
     this.m_CurrentChangeAttackDelay   = this.m_ChangeAttackTime;
 }
 public TaskGroupInfo(string groupName, VersionedId id, Guid groupClassId, TaskGroupType groupType, byte[] groupOrdinal, ExDateTime lastModifiedTime) : base(id, groupOrdinal, lastModifiedTime)
 {
     Util.ThrowOnNullArgument(groupName, "groupName");
     EnumValidator.ThrowIfInvalid <TaskGroupType>(groupType, "groupType");
     this.GroupName    = groupName;
     this.GroupClassId = groupClassId;
     this.GroupType    = groupType;
     this.TaskFolders  = new List <TaskGroupEntryInfo>();
 }
Beispiel #4
0
 public TaskGroup(TaskGroupType type)
 {
     Type  = type;
     Tasks = new List <TaskBase>();
 }
Beispiel #5
0
 public TaskGroup(TaskGroupType type)
 {
     this.Type  = type;
     this.Tasks = new List <TaskBase>();
 }
Beispiel #6
0
 public TaskGroup(TaskGroupType type)
 {
     this.Type = type;
     this.Tasks = new List<TaskBase>();
 }