Example #1
0
 /// <summary>
 /// Adds user generated waypoints to the location list.
 /// </summary>
 private void AddWaypointsToList(StarSystem starsystem)
 {
     foreach (Waypoint waypoint in starsystem.Waypoints)
     {
         if (waypoint.FactionId == CurrentTaskGroup.TaskGroupFaction.FactionID)
         {   
             string keyName = waypoint.Name;
             StarSystemEntity entObj = waypoint;
             SystemListObject valueObj = new SystemListObject(SystemListObject.ListEntityType.Waypoints, entObj);
             SystemLocationGuidDict.Add(entObj.Id, keyName);
             SystemLocationDict.Add(entObj.Id, valueObj);
         }
     }
 }
Example #2
0
 /// <summary>
 /// Adds friendly taskgroups to the system location box
 /// </summary>
 private void AddTaskGroupsToList(StarSystem starsystem)
 {           
     foreach(SystemContact contact in starsystem.SystemContactList)
     {
         if (contact.SSEntity == StarSystemEntityType.TaskGroup)
         {
             TaskGroupTN TaskGroup = contact.Entity as TaskGroupTN;
             if (CurrentTaskGroup != TaskGroup && TaskGroup.TaskGroupFaction == CurrentFaction)
             {
                 //m_oTaskGroupPanel.SystemLocationsListBox.Items.Add(CurrentTaskGroup.Contact.Position.System.SystemContactList[loop].TaskGroup);
                 string keyName = TaskGroup.Name;
                 StarSystemEntity entObj = TaskGroup;
                 SystemListObject valueObj = new SystemListObject(SystemListObject.ListEntityType.TaskGroups, entObj);
                 SystemLocationGuidDict.Add(entObj.Id, keyName);
                 SystemLocationDict.Add(entObj.Id, valueObj);
             }
         }
     }
 }
Example #3
0
        /// <summary>
        /// Add jump points to the available locations list.
        /// </summary>
        /// <param name="starsystem"></param>
#warning check to see if jump point is detected eventually when grav survey is implemented
        private void AddJumpPointsToList(StarSystem starsystem)
        {
            foreach (JumpPoint jp in starsystem.JumpPoints)
            {
                StarSystemEntity entObj = jp;
                SystemListObject.ListEntityType entType = SystemListObject.ListEntityType.JumpPoint;
                SystemListObject valueObj = new SystemListObject(entType, entObj);
                SystemLocationGuidDict.Add(entObj.Id, jp.Name);
                SystemLocationDict.Add(entObj.Id, valueObj);
            }
        }
Example #4
0
        /// <summary>
        /// Adds any detected ships to the system location box.
        /// </summary>
        private void AddContactsToList(StarSystem starsystem)
        {

            if (CurrentFaction.DetectedContactLists.ContainsKey(starsystem) == true)
            {
                foreach (KeyValuePair<ShipTN, FactionContact> pair in CurrentFaction.DetectedContactLists[CurrentTaskGroup.Contact.Position.System].DetectedContacts)
                {
                    String TH = "";
                    if (pair.Value.thermal == true)
                    {
                        TH = String.Format("[Thermal {0}]", pair.Key.CurrentThermalSignature);
                    }

                    String EM = "";
                    if (pair.Value.EM == true)
                    {
                        EM = String.Format("[EM {0}]", pair.Key.CurrentEMSignature);
                    }

                    String ACT = "";
                    if (pair.Value.active == true)
                    {
                        ACT = String.Format("[ACT {0}]", pair.Key.TotalCrossSection);
                    }

                    String Entry = String.Format("{0} {1}{2}{3}", pair.Key.Name, TH, EM, ACT);

                    //m_oTaskGroupPanel.SystemLocationsListBox.Items.Add(Entry);
                    SystemListObject.ListEntityType entType = SystemListObject.ListEntityType.Contacts;
                    SystemListObject valueObj = new SystemListObject(entType, pair.Key); //maybe this should be the value? though with the key I can *get* the value easly anyway.
                    SystemLocationGuidDict.Add(pair.Key.Id, Entry);
                    SystemLocationDict.Add(pair.Key.Id, valueObj);
                }

                foreach (KeyValuePair<Population, FactionContact> pair in CurrentFaction.DetectedContactLists[CurrentTaskGroup.Contact.Position.System].DetectedPopContacts)
                {
                    String TH = "";
                    if (pair.Value.thermal == true)
                    {
                        TH = String.Format("[Thermal {0}]", pair.Key.ThermalSignature);
                    }

                    String EM = "";
                    if (pair.Value.EM == true)
                    {
                        EM = String.Format("[EM {0}]", pair.Key.EMSignature);
                    }

                    String ACT = "";
                    if (pair.Value.active == true)
                    {
                        ACT = String.Format("[Active Ping]");
                    }

                    String Entry = String.Format("{0} {1}{2}{3}", pair.Key.Name, TH, EM, ACT);

                    //m_oTaskGroupPanel.SystemLocationsListBox.Items.Add(Entry);
                    SystemListObject.ListEntityType entType = SystemListObject.ListEntityType.Contacts;
                    SystemListObject valueObj = new SystemListObject(entType, pair.Key); //maybe this should be the value? though with the key I can *get* the value easly anyway.
                    SystemLocationGuidDict.Add(pair.Key.Id, Entry);
                    SystemLocationDict.Add(pair.Key.Id, valueObj);
                }
            }
        }
Example #5
0
        /// <summary>
        /// Add every planet in the system that this TG is in to the list.
        /// Eventually jump orders will modify this. to be the system at the end of the order stack.
        /// </summary>
        private void AddPlanetsToList(StarSystem starsystem)
        {
            foreach (Star star in starsystem.Stars)
            {
                foreach (SystemBody planet in star.Planets)
                {
                    int PopCount = 0;
                    string keyName = "N/A";
                    foreach(Population CurrentPopulation in planet.Populations)
                    {
                        if (CurrentPopulation.Faction == CurrentFaction)
                        {
                            keyName = string.Format("{0} - {1}",CurrentPopulation.Name, CurrentPopulation.Species.Name);
                            if(CurrentFaction.Capitol == CurrentPopulation)
                                keyName = string.Format("{0}(Capitol)", keyName);

                            keyName = string.Format("{0}: {1:n2}m", keyName, CurrentPopulation.CivilianPopulation);

                            StarSystemEntity entObj = CurrentPopulation;
                            SystemListObject.ListEntityType entType = SystemListObject.ListEntityType.Colonies;
                            SystemListObject valueObj = new SystemListObject(entType, entObj);
                            SystemLocationGuidDict.Add(entObj.Id, keyName);
                            SystemLocationDict.Add(entObj.Id, valueObj);

                            PopCount++;
                        }
                    }

                    if (PopCount == 0)
                    {
                        //m_oTaskGroupPanel.SystemLocationsListBox.Items.Add(CurrentTaskGroup.Contact.Position.System.Stars[loop].Planets[loop2]);
                        keyName = planet.Name;//CurrentTaskGroup.Contact.Position.System.Stars[loop].Planets[loop2].Name;
                        StarSystemEntity entObj = planet;//CurrentTaskGroup.Contact.Position.System.Stars[loop].Planets[loop2];
                        SystemListObject.ListEntityType entType = SystemListObject.ListEntityType.Planets;
                        SystemListObject valueObj = new SystemListObject(entType, entObj);
                        SystemLocationGuidDict.Add(entObj.Id, keyName);
                        SystemLocationDict.Add(entObj.Id, valueObj);
                    }
                }
            }
        }