diff --git a/Pulsar4X/Pulsar4X.Lib/Constants.cs b/Pulsar4X/Pulsar4X.Lib/Constants.cs
index 9796efc86..3885cfcb2 100644
--- a/Pulsar4X/Pulsar4X.Lib/Constants.cs
+++ b/Pulsar4X/Pulsar4X.Lib/Constants.cs
@@ -984,6 +984,42 @@ public static class Faction
public const int FactionMax = 64;
}
+ ///
+ /// Colony related constants
+ ///
+ public static class Colony
+ {
+ ///
+ /// Thermal signature per million pop.
+ ///
+ public static float CivilianThermalSignature = 5.0f;
+
+ ///
+ /// EM signature per million pop.
+ ///
+ public static float CivilianEMSignature = 50.0f;
+
+
+ ///
+ /// For Thermal and EM signature calculations.
+ ///
+ public static float NavalShipyardTonnageDivisor = 50.0f;
+
+ ///
+ /// For Thermal and EM signature calculations.
+ ///
+ public static float CommercialShipyardTonnageDivisor = 500.0f;
+ ///
+ /// What sensor strength will a single DSTS add? This is about equal to a full sized thermal sensor array at each tech level.
+ ///
+ public static int[] DeepSpaceStrength = { 250, 300, 400, 550, 700, 900, 1200, 1600, 2000, 2500, 3000, 3750 };
+
+ ///
+ /// Maximum index to DeepSpaceStrength
+ ///
+ public const int DeepSpaceMax = 11;
+ }
+
///
/// Tick times to complete said interval.
///
diff --git a/Pulsar4X/Pulsar4X.Lib/Entities/Faction.cs b/Pulsar4X/Pulsar4X.Lib/Entities/Faction.cs
index ab3db1080..7cb6e27cf 100644
--- a/Pulsar4X/Pulsar4X.Lib/Entities/Faction.cs
+++ b/Pulsar4X/Pulsar4X.Lib/Entities/Faction.cs
@@ -1007,6 +1007,7 @@ public Faction(int ID)
FactionTechLevel[(int)Faction.FactionTechnology.MissileAgility] = 0;
FactionTechLevel[(int)Faction.FactionTechnology.TurretTracking] = 0;
FactionTechLevel[(int)Faction.FactionTechnology.ECCM] = 0;
+ FactionTechLevel[(int)Faction.FactionTechnology.DSTSSensorStrength] = 0;
#warning FastOOB magic numbers
ShipBPTotal = 8000.0m;
@@ -1094,6 +1095,7 @@ public Faction(string a_oName, Species a_oSpecies, int ID)
FactionTechLevel[(int)Faction.FactionTechnology.MissileAgility] = 0;
FactionTechLevel[(int)Faction.FactionTechnology.TurretTracking] = 0;
FactionTechLevel[(int)Faction.FactionTechnology.ECCM] = 0;
+ FactionTechLevel[(int)Faction.FactionTechnology.DSTSSensorStrength] = 0;
#warning FastOOB magic numbers
ShipBPTotal = 8000.0m;
diff --git a/Pulsar4X/Pulsar4X.Lib/Entities/Gas.cs b/Pulsar4X/Pulsar4X.Lib/Entities/Gas.cs
index 79495e505..76b264c3d 100644
--- a/Pulsar4X/Pulsar4X.Lib/Entities/Gas.cs
+++ b/Pulsar4X/Pulsar4X.Lib/Entities/Gas.cs
@@ -6,7 +6,7 @@
namespace Pulsar4X.Entities
{
- public class Gas
+ public class Gas : GameEntity
{
public int MoleculeId { get; set; }
public double SurfacePressure { get; set; } //units of millibars (mb)
diff --git a/Pulsar4X/Pulsar4X.Lib/Entities/Installation.cs b/Pulsar4X/Pulsar4X.Lib/Entities/Installation.cs
index 7742ddcd9..26609df3c 100644
--- a/Pulsar4X/Pulsar4X.Lib/Entities/Installation.cs
+++ b/Pulsar4X/Pulsar4X.Lib/Entities/Installation.cs
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
+using System.ComponentModel;
using Pulsar4X.Entities;
namespace Pulsar4X.Entities
@@ -14,10 +15,12 @@ public enum InstallationType
CivilianMiningComplex,
CommercialShipyard,
ConstructionFactory,
+ ConventionalIndustry,
DeepSpaceTrackingStation,
FighterFactory,
FinancialCentre,
FuelRefinery,
+ GeneticModificationCentre,
GroundForceTrainingFacility,
Infrastructure,
MaintenanceFacility,
@@ -33,13 +36,45 @@ public enum InstallationType
InstallationCount
}
- public const int NO_OF_INSTALLATIONS = 20;
+ public const int NO_OF_INSTALLATIONS = (int)InstallationType.InstallationCount;
public InstallationType Type { get; set; }
+ ///
+ /// amount of wealth and resource units to build.
+ ///
public int Cost { get; set; }
+
+ ///
+ /// Number of this installation that a colony has
+ ///
public float Number { get; set; }
+
+ ///
+ /// Size of this installation for cargo transfering.
+ ///
public int Mass { get; set; }
+
+ ///
+ /// What thermal signature does this installation have.
+ ///
+ public float ThermalSignature { get; set; }
+
+ ///
+ /// What EM Signature does this installation have.
+ ///
+ public float EMSignature { get; set; }
+
+ ///
+ /// Shipyard tonnage.
+ ///
+ public BindingList Tonnage { get; set; }
+
+ ///
+ /// Shipyard slipway count.
+ ///
+ public BindingList Slipways { get; set; }
+
int[] m_aiMinerialsCost;
public int[] MinerialsCost
{
@@ -63,8 +98,12 @@ public Installation(InstallationType a_eType)
{
Number = 0;
Mass = 25000;
+ Tonnage = new BindingList();
+ Slipways = new BindingList();
Type = a_eType;
m_aiMinerialsCost = new int[Constants.Minerals.NO_OF_MINERIALS];
+ ThermalSignature = 0;
+ EMSignature = 0;
switch (a_eType)
{
@@ -74,11 +113,15 @@ public Installation(InstallationType a_eType)
Cost = 240;
m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium] = 120;
m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Corundium] = 120;
+ ThermalSignature = 5;
+ EMSignature = 5;
break;
}
case InstallationType.CivilianMiningComplex:
{
Name = "Civilian Mining Complex";
+ ThermalSignature = 50;
+ EMSignature = 0;
break;
}
case InstallationType.CommercialShipyard:
@@ -88,6 +131,14 @@ public Installation(InstallationType a_eType)
m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium] = 1200;
m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Neutronium] = 1200;
Mass = 100000;
+ Tonnage.Add(10000);
+ Slipways.Add(1);
+
+ ///
+ /// For base
+ ///
+ ThermalSignature = 220;
+ EMSignature = 110;
break;
}
case InstallationType.ConstructionFactory:
@@ -97,6 +148,19 @@ public Installation(InstallationType a_eType)
m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium] = 60;
m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Tritanium] = 30;
m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Corundium] = 30;
+ ThermalSignature = 5;
+ EMSignature = 5;
+ break;
+ }
+ case InstallationType.ConventionalIndustry:
+ {
+ Name = "Conventional Industry";
+ ///
+ /// CI can't be built, but cna be converted for 20 cost to make other installations.
+ ///
+ Cost = 20;
+ ThermalSignature = 5;
+ EMSignature = 5;
break;
}
case InstallationType.DeepSpaceTrackingStation:
@@ -105,6 +169,8 @@ public Installation(InstallationType a_eType)
Cost = 300;
m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium] = 150;
m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Uridium] = 150;
+ ThermalSignature = 5;
+ EMSignature = 0;
break;
}
case InstallationType.FighterFactory:
@@ -113,6 +179,8 @@ public Installation(InstallationType a_eType)
Cost = 120;
m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium] = 30;
m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Uridium] = 90;
+ ThermalSignature = 5;
+ EMSignature = 5;
break;
}
case InstallationType.FinancialCentre:
@@ -121,6 +189,8 @@ public Installation(InstallationType a_eType)
Cost = 240;
m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Corbomite] = 120;
m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Uridium] = 120;
+ ThermalSignature = 5;
+ EMSignature = 50;
break;
}
case InstallationType.FuelRefinery:
@@ -128,6 +198,21 @@ public Installation(InstallationType a_eType)
Name = "Fuel Refinery";
Cost = 120;
m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium] = 120;
+ ThermalSignature = 5;
+ EMSignature = 5;
+ break;
+ }
+ case InstallationType.GeneticModificationCentre:
+ {
+ Name = "Genetic Modification Centre";
+ Cost = 2400;
+ m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium] = 300;
+ m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Corbomite] = 1200;
+ m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Boronide] = 600;
+ m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Mercassium] = 300;
+ Mass = 50000;
+ ThermalSignature = 10;
+ EMSignature = 50;
break;
}
case InstallationType.GroundForceTrainingFacility:
@@ -137,6 +222,8 @@ public Installation(InstallationType a_eType)
m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium] = 1200;
m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Neutronium] = 1200;
Mass = 100000;
+ ThermalSignature = 10;
+ EMSignature = 100;
break;
}
case InstallationType.Infrastructure:
@@ -145,6 +232,8 @@ public Installation(InstallationType a_eType)
Cost = 2;
m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium] = 2;
Mass = 2500;
+ ThermalSignature = 0.5f;
+ EMSignature = 0.5f;
break;
}
case InstallationType.MaintenanceFacility:
@@ -153,6 +242,8 @@ public Installation(InstallationType a_eType)
Cost = 150;
m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium] = 75;
m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Neutronium] = 75;
+ ThermalSignature = 5;
+ EMSignature = 5;
break;
}
case InstallationType.MassDriver:
@@ -162,7 +253,8 @@ public Installation(InstallationType a_eType)
m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium] = 100;
m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Neutronium] = 100;
m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Boronide] = 100;
-
+ ThermalSignature = 5;
+ EMSignature = 5;
break;
}
case InstallationType.MilitaryAcademy:
@@ -175,6 +267,8 @@ public Installation(InstallationType a_eType)
m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Uridium] = 300;
m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Corundium] = 300;
Mass = 100000;
+ ThermalSignature = 10;
+ EMSignature = 100;
break;
}
case InstallationType.Mine:
@@ -183,6 +277,8 @@ public Installation(InstallationType a_eType)
Cost = 120;
m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium] = 60;
m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Corundium] = 60;
+ ThermalSignature = 5;
+ EMSignature = 5;
break;
}
case InstallationType.NavalShipyardComplex:
@@ -192,6 +288,13 @@ public Installation(InstallationType a_eType)
m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium] = 1200;
m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Neutronium] = 1200;
Mass = 100000;
+ Tonnage.Add(1000);
+ Slipways.Add(1);
+ ///
+ /// base signatures.
+ ///
+ ThermalSignature = 220;
+ EMSignature = 110;
break;
}
case InstallationType.OrdnanceFactory:
@@ -200,6 +303,8 @@ public Installation(InstallationType a_eType)
Cost = 120;
m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium] = 30;
m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Tritanium] = 90;
+ ThermalSignature = 5;
+ EMSignature = 5;
break;
}
case InstallationType.ResearchLab:
@@ -209,6 +314,8 @@ public Installation(InstallationType a_eType)
m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium] = 1200;
m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Mercassium] = 1200;
Mass = 100000;
+ ThermalSignature = 50;
+ EMSignature = 100;
break;
}
case InstallationType.SectorCommand:
@@ -220,6 +327,8 @@ public Installation(InstallationType a_eType)
m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Mercassium] = 600;
m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Uridium] = 600;
Mass = 100000;
+ ThermalSignature = 20;
+ EMSignature = 150;
break;
}
case InstallationType.Spaceport:
@@ -232,6 +341,8 @@ public Installation(InstallationType a_eType)
m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Mercassium] = 300;
m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Uridium] = 300;
Mass = 50000;
+ ThermalSignature = 50;
+ EMSignature = 100;
break;
}
case InstallationType.TerraformingInstallation:
@@ -241,6 +352,8 @@ public Installation(InstallationType a_eType)
m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Duranium] = 300;
m_aiMinerialsCost[(int)Constants.Minerals.MinerialNames.Boronide] = 300;
Mass = 50000;
+ ThermalSignature = 100;
+ EMSignature = 25;
break;
}
}
diff --git a/Pulsar4X/Pulsar4X.Lib/Entities/Molecule.cs b/Pulsar4X/Pulsar4X.Lib/Entities/Molecule.cs
index 2af446f62..e8be7e497 100644
--- a/Pulsar4X/Pulsar4X.Lib/Entities/Molecule.cs
+++ b/Pulsar4X/Pulsar4X.Lib/Entities/Molecule.cs
@@ -5,11 +5,15 @@
namespace Pulsar4X.Entities
{
- public class Molecule
+ public class Molecule : GameEntity
{
+ ///
+ /// Does this need an Id separate from the GameEntity Guid?
+ ///
public int Id { get; set; }
+
+
public string Symbol { get; set; }
- public string Name { get; set; }
public double AtomicWeight { get; set; }
public double MeltingPoint { get; set; }
public double BoilingPoint { get; set; }
diff --git a/Pulsar4X/Pulsar4X.Lib/Entities/Planet.cs b/Pulsar4X/Pulsar4X.Lib/Entities/Planet.cs
index ced88ec10..e1b32c4fc 100644
--- a/Pulsar4X/Pulsar4X.Lib/Entities/Planet.cs
+++ b/Pulsar4X/Pulsar4X.Lib/Entities/Planet.cs
@@ -14,6 +14,14 @@ namespace Pulsar4X.Entities
{
public class Planet : OrbitingEntity
{
+ public enum Tectonics
+ {
+ Dead,
+ Minimal,
+ Earthlike,
+ Volcanic,
+ Count
+ }
#if LOG4NET_ENABLED
public static readonly ILog logger = LogManager.GetLogger(typeof(Planet));
@@ -29,6 +37,11 @@ public class Planet : OrbitingEntity
///
public Dictionary GeoSurveyList { get; set; }
+ ///
+ /// Has a geological team surveyed this world?
+ ///
+ public bool GeoTeamSurvey { get; set; }
+
//TODO: Currently Id is only unique in the star it belongs to, not unique across multiple stars
public PlanetTypes PlanetType { get; set; }
public bool IsGasGiant { get; set; }
@@ -165,6 +178,12 @@ public string PlanetTypeView
///
public Ruins PlanetaryRuins { get; set; }
+
+ ///
+ /// How geologically active is this planet. will this be used?
+ ///
+ public Tectonics PlanetaryTectonics { get; set; }
+
public Planet(Star primary, OrbitingEntity parent) : base()
{
Moons = new BindingList();
@@ -172,6 +191,7 @@ public Planet(Star primary, OrbitingEntity parent) : base()
Populations = new BindingList();
GeoSurveyList = new Dictionary();
+ GeoTeamSurvey = false;
SSEntity = StarSystemEntityType.Body;
@@ -181,7 +201,9 @@ public Planet(Star primary, OrbitingEntity parent) : base()
TaskGroupsInOrbit = new BindingList();
#warning planet generation needs minerals, anomalies, and ruins generation.
- PlanetaryRuins = null;
+ PlanetaryRuins = new Ruins();
+
+ PlanetaryTectonics = Tectonics.Dead;
}
///
diff --git a/Pulsar4X/Pulsar4X.Lib/Entities/Population.cs b/Pulsar4X/Pulsar4X.Lib/Entities/Population.cs
index 98680865c..a7eb3eab5 100644
--- a/Pulsar4X/Pulsar4X.Lib/Entities/Population.cs
+++ b/Pulsar4X/Pulsar4X.Lib/Entities/Population.cs
@@ -12,6 +12,19 @@ namespace Pulsar4X.Entities
{
public class Population : GameEntity
{
+
+ ///
+ /// What is the political situation on this colony? how productive is it and how much of a military presence is needed to hold control of it.
+ ///
+ public enum PoliticalStatus
+ {
+ Conquered,
+ Subjugated,
+ Occupied,
+ Candidate,
+ Imperial,
+ Count
+ }
#region Properties
///
@@ -39,6 +52,11 @@ public class Population : GameEntity
///
public Commander PopulationGovernor { get; set; }
+ ///
+ /// How skilled in administration should the Planetary Governor be?
+ ///
+ public int AdminRating { get; set; }
+
///
/// The contact that this population is associated with.
///
@@ -75,13 +93,21 @@ public class Population : GameEntity
public float FuelStockpile { get; set; }
public int MaintenanceSupplies { get; set; }
+ ///
+ /// What is the situation of this colony.
+ ///
+ public PoliticalStatus PoliticalPopStatus { get; set; }
+
public float PopulationWorkingInAgriAndEnviro
{
get
{
// 5% of civi pop
- return CivilianPopulation * 0.05f;
+
+ //5 + 5 * ColonyCost
+ float Agriculture = 0.05f + (0.05f * (float)Species.ColonyCost(Planet));
+ return CivilianPopulation * Agriculture;
}
}
@@ -90,7 +116,13 @@ public float PopulationWorkingInServiceIndustries
get
{
// 75% of Civi Pop
- return CivilianPopulation * 0.75f;
+ //ServicePercent = Sqr(Sqr(TotalPop * 100000)) / 100
+ float ServicePercent = (float)(Math.Sqrt(Math.Sqrt((double)CivilianPopulation * 100000.0)) / 100.0);
+ if (ServicePercent > 0.75f)
+ ServicePercent = 0.75f;
+
+ float pop = CivilianPopulation - PopulationWorkingInAgriAndEnviro;
+ return ServicePercent * pop;
}
}
@@ -99,18 +131,14 @@ public float PopulationWorkingInManufacturing
get
{
// 20% of civi pop
- return CivilianPopulation * 0.20f;
+ return CivilianPopulation - (PopulationWorkingInAgriAndEnviro + PopulationWorkingInServiceIndustries);
}
}
- public int EMSignature
- {
- get
- {
- // Todo: Proper Formula for EM Sig!
- return (int)((CivilianPopulation * CivilianPopulation) / 10);
- }
- }
+ ///
+ /// EM Signature is related to population.
+ ///
+ public int EMSignature { get; set; }
int[] m_aiMinerials;
@@ -212,6 +240,7 @@ public Population(Planet a_oPlanet, Faction a_oFaction, String a_oName = "Earth"
Contact = new SystemContact(Faction,this);
GovernorPresent = false;
+ AdminRating = 0;
ComponentStockpile = new BindingList();
ComponentStockpileCount = new BindingList();
@@ -219,9 +248,48 @@ public Population(Planet a_oPlanet, Faction a_oFaction, String a_oName = "Earth"
MissileStockpile = new Dictionary();
OrbitalTerraformModules = 0.0f;
+
+ PoliticalPopStatus = PoliticalStatus.Imperial;
+
+ for (int InstallationIterator = 0; InstallationIterator < (int)Installation.InstallationType.InstallationCount; InstallationIterator++)
+ {
+ Installations[InstallationIterator].Number = 0.0f;
+ }
+
+ FuelStockpile = 0.0f;
+ MaintenanceSupplies = 0;
+ EMSignature = 0;
+ ThermalSignature = 0;
+ ModifierEconomicProduction = 1.0f;
+ ModifierManfacturing = 1.0f;
+ ModifierProduction = 1.0f;
+ ModifierWealthAndTrade = 1.0f;
+ ModifierPoliticalStability = 1.0f;
+
+ ConventionalStart();
}
+ public void ConventionalStart()
+ {
+ Installations[(int)Installation.InstallationType.ConventionalIndustry].Number = 1000.0f;
+ Installations[(int)Installation.InstallationType.DeepSpaceTrackingStation].Number = 1.0f;
+ Installations[(int)Installation.InstallationType.MilitaryAcademy].Number = 1.0f;
+ Installations[(int)Installation.InstallationType.NavalShipyardComplex].Number = 1.0f;
+ Installations[(int)Installation.InstallationType.MaintenanceFacility].Number = 5.0f;
+ Installations[(int)Installation.InstallationType.ResearchLab].Number = 5.0f;
+
+ FuelStockpile = 0.0f;
+ MaintenanceSupplies = 2000;
+
+ CivilianPopulation = 500.0f;
+ }
+
+ public void TNStart()
+ {
+ CivilianPopulation = 500.0f;
+ }
+
///
/// I am not sure if this will be necessary but since the population has detection statistics it should have a contact with an accessible
/// location to the SystemContactList.
@@ -353,5 +421,81 @@ public int LoadMissileToStockpile(OrdnanceDefTN Missile, int inc)
}
}
}
+
+ ///
+ /// Calculate the thermal signature of this colony
+ ///
+ /// Thermal Signature
+ public int CalcThermalSignature()
+ {
+ int signature = (int)Math.Round(CivilianPopulation * Constants.Colony.CivilianThermalSignature);
+ foreach (Installation Inst in m_aoInstallations)
+ {
+ if (Inst.Type == Installation.InstallationType.CommercialShipyard)
+ {
+ int ThermalBase = (int)Inst.ThermalSignature;
+ int SYCount = (int)Math.Floor(Inst.Number);
+ for (int SYIterator = 0; SYIterator < SYCount; SYIterator++)
+ {
+ int totalTons = Inst.Tonnage[SYIterator] * Inst.Slipways[SYIterator];
+ signature = signature + ThermalBase + (int)Math.Round((float)totalTons / Constants.Colony.CommercialShipyardTonnageDivisor);
+ }
+ }
+ else if (Inst.Type == Installation.InstallationType.NavalShipyardComplex)
+ {
+ int ThermalBase = (int)Inst.ThermalSignature;
+ int SYCount = (int)Math.Floor(Inst.Number);
+ for (int SYIterator = 0; SYIterator < SYCount; SYIterator++)
+ {
+ int totalTons = Inst.Tonnage[SYIterator] * Inst.Slipways[SYIterator];
+ signature = signature + ThermalBase + (int)Math.Round((float)totalTons / Constants.Colony.NavalShipyardTonnageDivisor);
+ }
+ }
+ else
+ {
+ signature = signature + (int)Math.Round(Inst.ThermalSignature * Math.Floor(Inst.Number));
+ }
+ }
+ ThermalSignature = signature;
+ return signature;
+ }
+
+ ///
+ /// Calculate the EM signature of this colony
+ ///
+ /// EM Signature
+ public int CalcEMSignature()
+ {
+ int signature = (int)Math.Round(CivilianPopulation * Constants.Colony.CivilianEMSignature);
+ foreach (Installation Inst in m_aoInstallations)
+ {
+ if (Inst.Type == Installation.InstallationType.CommercialShipyard)
+ {
+ int EMBase = (int)Inst.EMSignature;
+ int SYCount = (int)Math.Floor(Inst.Number);
+ for (int SYIterator = 0; SYIterator < SYCount; SYIterator++)
+ {
+ int totalTons = Inst.Tonnage[SYIterator] * Inst.Slipways[SYIterator];
+ signature = signature + EMBase + (int)Math.Round((float)totalTons / Constants.Colony.CommercialShipyardTonnageDivisor);
+ }
+ }
+ else if (Inst.Type == Installation.InstallationType.NavalShipyardComplex)
+ {
+ int EMBase = (int)Inst.EMSignature;
+ int SYCount = (int)Math.Floor(Inst.Number);
+ for (int SYIterator = 0; SYIterator < SYCount; SYIterator++)
+ {
+ int totalTons = Inst.Tonnage[SYIterator] * Inst.Slipways[SYIterator];
+ signature = signature + EMBase + (int)Math.Round((float)totalTons / Constants.Colony.NavalShipyardTonnageDivisor);
+ }
+ }
+ else
+ {
+ signature = signature + (int)Math.Round(Inst.EMSignature * Math.Floor(Inst.Number));
+ }
+ }
+ EMSignature = signature;
+ return signature;
+ }
}
}
diff --git a/Pulsar4X/Pulsar4X.Lib/Entities/Ruins.cs b/Pulsar4X/Pulsar4X.Lib/Entities/Ruins.cs
index d32bd4b42..82db31f00 100644
--- a/Pulsar4X/Pulsar4X.Lib/Entities/Ruins.cs
+++ b/Pulsar4X/Pulsar4X.Lib/Entities/Ruins.cs
@@ -11,6 +11,25 @@ namespace Pulsar4X.Entities
{
public class Ruins : GameEntity
{
+ public enum RSize
+ {
+ NoRuins,
+ Outpost,
+ Settlement,
+ Colony,
+ City,
+ Count
+ }
+
+ public enum RQuality
+ {
+ Destroyed,
+ Ruined,
+ PartiallyIntact,
+ Intact,
+ MultipleIntact,
+ Count
+ }
///
/// Which factions have uncovered the extent of these ruins
///
@@ -26,14 +45,119 @@ public class Ruins : GameEntity
///
public int RuinTechLevel { get; set; }
- public Ruins(int a_oCount, int a_oTL)
+
+ ///
+ /// How big are these ruins?
+ ///
+ public RSize RuinSize { get; set; }
+
+ ///
+ /// What shape are these ruins in?
+ ///
+ public RQuality RuinQuality { get; set; }
+
+ public Ruins(bool GenerateRuins=false)
{
#warning Generate a name/race for the ruins, and also how should difficulty be effected by having 2 ruins of the same race, with one already looted?
- RuinDiscovery = new BindingList();
+ RuinTechLevel = GameState.RNG.Next(5);
+
+ RuinSize = RSize.NoRuins;
+ RuinQuality = RQuality.Destroyed;
+ RuinCount = 0;
+
+ if (GenerateRuins == true)
+ {
+ RuinDiscovery = new BindingList();
+
+ int size = GameState.RNG.Next(0, 100);
+
+ if (size < 40)
+ {
+ RuinSize = RSize.Outpost;
+ }
+ else if (size < 70)
+ {
+ RuinSize = RSize.Settlement;
+ }
+ else if (size < 90)
+ {
+ RuinSize = RSize.Colony;
+ }
+ else
+ {
+ RuinSize = RSize.City;
+ }
+
+ int quality = GameState.RNG.Next(0, 100);
+
+ if (quality < 40)
+ {
+ RuinQuality = RQuality.Destroyed;
+ }
+ else if (quality < 70)
+ {
+ RuinQuality = RQuality.Ruined;
+ }
+ else if (quality < 80)
+ {
+ RuinQuality = RQuality.PartiallyIntact;
+ }
+ else if (quality < 90)
+ {
+ RuinQuality = RQuality.Intact;
+
+ if (RuinSize == RSize.City && quality >= 95)
+ {
+ RuinQuality = RQuality.MultipleIntact;
+ }
+ }
+
+
+ int RC = 0;
+
+ ///
+ /// Ruins size range:
+ ///
+ switch (RuinSize)
+ {
+ case RSize.Outpost:
+ RC = GameState.RNG.Next(15, 50);
+ break;
+ case RSize.Settlement:
+ RC = GameState.RNG.Next(50, 100);
+ break;
+ case RSize.Colony:
+ RC = GameState.RNG.Next(100, 200);
+ break;
+ case RSize.City:
+ RC = GameState.RNG.Next(500, 1000);
+ break;
+ }
- RuinCount = a_oCount;
+ ///
+ /// Ruins quality adjustment.
+ ///
+ switch (RuinQuality)
+ {
+ case RQuality.Destroyed:
+ RC = (int)Math.Round((float)RC * 1.25f);
+ break;
+ case RQuality.Ruined:
+ RC = (int)Math.Round((float)RC * 1.5f);
+ break;
+ case RQuality.PartiallyIntact:
+ RC = (int)Math.Round((float)RC * 1.75f);
+ break;
+ case RQuality.Intact:
+ RC = (int)Math.Round((float)RC * 2.0f);
+ break;
+ case RQuality.MultipleIntact:
+ RC = (int)Math.Round((float)RC * 3.0f);
+ break;
+ }
- RuinTechLevel = a_oTL;
+ RuinCount = RC;
+ }
}
}
}
diff --git a/Pulsar4X/Pulsar4X.Lib/Entities/ShipClass.cs b/Pulsar4X/Pulsar4X.Lib/Entities/ShipClass.cs
index 3cdee0dd7..7ada061a0 100644
--- a/Pulsar4X/Pulsar4X.Lib/Entities/ShipClass.cs
+++ b/Pulsar4X/Pulsar4X.Lib/Entities/ShipClass.cs
@@ -1848,6 +1848,7 @@ public void AddBeamWeapon(BeamDefTN Beam, short inc)
}
TotalPowerRequirement = TotalPowerRequirement + (int)(Beam.powerRequirement * inc);
+ PlanetaryProtectionValue = PlanetaryProtectionValue + (int)(Beam.powerRequirement * inc);
UpdateClass(Beam, inc);
}
@@ -2036,6 +2037,7 @@ public void AddLauncher(MissileLauncherDefTN Tube, short inc)
LauncherCount = LauncherCount + inc;
LauncherMagSpace = LauncherMagSpace + ((int)Tube.launchMaxSize * inc);
TotalMagazineCapacity = TotalMagazineCapacity + ((int)Tube.launchMaxSize * inc);
+ PlanetaryProtectionValue = PlanetaryProtectionValue + ((int)Tube.launchMaxSize * inc);
UpdateClass(Tube, inc);
}
diff --git a/Pulsar4X/Pulsar4X.Lib/Entities/Species.cs b/Pulsar4X/Pulsar4X.Lib/Entities/Species.cs
index 1ce3bbe96..01167a605 100644
--- a/Pulsar4X/Pulsar4X.Lib/Entities/Species.cs
+++ b/Pulsar4X/Pulsar4X.Lib/Entities/Species.cs
@@ -18,6 +18,9 @@ public class Species : GameEntity
public double MinimumTemperatureConstraint { get; set; }
public double MaximumTemperatureConstraint { get; set; }
+ ///
+ /// Probably a list of toxic gases for this species.
+ ///
public List GasConstraints { get; set; }
public Species()
@@ -31,7 +34,7 @@ public Species()
MaximumGravityConstraint = 1.9;
BasePressure = 1.0;
MinimumPressureConstraint = 0.4;
- MaximumPressureConstraint = 2.0;
+ MaximumPressureConstraint = 4.0;
BaseTemperature = 14.0;
MinimumTemperatureConstraint = -15.0;
MaximumTemperatureConstraint = 45.0;
diff --git a/Pulsar4X/Pulsar4X.Lib/Entities/SpeciesGasConstraint.cs b/Pulsar4X/Pulsar4X.Lib/Entities/SpeciesGasConstraint.cs
index 948a9bbce..40fe5e09f 100644
--- a/Pulsar4X/Pulsar4X.Lib/Entities/SpeciesGasConstraint.cs
+++ b/Pulsar4X/Pulsar4X.Lib/Entities/SpeciesGasConstraint.cs
@@ -6,7 +6,7 @@
namespace Pulsar4X.Entities
{
- public class SpeciesGasConstraint
+ public class SpeciesGasConstraint : GameEntity
{
public Molecule Molecule { get; set; }
public double Minimum { get; set; }
diff --git a/Pulsar4X/Pulsar4X.Lib/Entities/StarSystem.cs b/Pulsar4X/Pulsar4X.Lib/Entities/StarSystem.cs
index 3cc91e488..38a139ba8 100644
--- a/Pulsar4X/Pulsar4X.Lib/Entities/StarSystem.cs
+++ b/Pulsar4X/Pulsar4X.Lib/Entities/StarSystem.cs
@@ -206,5 +206,30 @@ public void RemoveContact(SystemContact Contact)
GameState.Instance.Factions[0].MessageLog.Add(Entry2);
}
}
+
+ ///
+ /// Get the PPV level for this faction in this system.
+ ///
+ /// Faction to find PPV for
+ /// PPV value
+ public int GetProtectionLevel(Faction fact)
+ {
+ int PPV = 0;
+ foreach (SystemContact Contact in SystemContactList)
+ {
+ if (Contact.SSEntity == StarSystemEntityType.TaskGroup)
+ {
+ if (Contact.TaskGroup.TaskGroupFaction == fact)
+ {
+ foreach (ShipTN Ship in Contact.TaskGroup.Ships)
+ {
+ PPV = PPV + Ship.ShipClass.PlanetaryProtectionValue;
+ }
+ }
+ }
+ }
+
+ return PPV;
+ }
}
}
diff --git a/Pulsar4X/Pulsar4X.UI/Handlers/Economics.cs b/Pulsar4X/Pulsar4X.UI/Handlers/Economics.cs
index c88b0ba6c..bd8f8d8df 100644
--- a/Pulsar4X/Pulsar4X.UI/Handlers/Economics.cs
+++ b/Pulsar4X/Pulsar4X.UI/Handlers/Economics.cs
@@ -23,6 +23,9 @@ public class Economics
public static readonly ILog logger = LogManager.GetLogger(typeof(Economics));
#endif
+ ///
+ /// Currently selected faction/empire
+ ///
private Faction m_oCurrnetFaction;
public Faction CurrentFaction
{
@@ -32,11 +35,35 @@ public Faction CurrentFaction
if (value != m_oCurrnetFaction)
{
m_oCurrnetFaction = value;
+ if(m_oCurrnetFaction.Populations.Count != 0)
+ m_oCurrnetPopulation = m_oCurrnetFaction.Populations[0];
+ RefreshPanels();
+ }
+ }
+ }
+
+ ///
+ /// Which planetary population is selected.
+ ///
+ private Population m_oCurrnetPopulation;
+ public Population CurrentPopulation
+ {
+ get { return m_oCurrnetPopulation; }
+ set
+ {
+ if (value != m_oCurrnetPopulation)
+ {
+ m_oCurrnetPopulation = value;
RefreshPanels();
}
}
}
+ ///
+ /// This dictionary stores the populations currently in the tree view, and the strings they are keyed as.
+ ///
+ private Dictionary TreeViewDictionary { get; set; }
+
///
/// Panel that contains the currently selected population summary. The summary panel is going to hold all the various panels now.
///
@@ -62,6 +89,11 @@ public Economics()
// Create Viewmodel:
VM = new EconomicsViewModel();
+ ///
+ /// Create the tree view dictionary obviously.
+ ///
+ TreeViewDictionary = new Dictionary();
+
// create Bindings:
m_oSummaryPanel.FactionComboBox.Bind(c => c.DataSource, VM, d => d.Factions);
m_oSummaryPanel.FactionComboBox.Bind(c => c.SelectedItem, VM, d => d.CurrentFaction, DataSourceUpdateMode.OnPropertyChanged);
@@ -77,6 +109,11 @@ public Economics()
m_oSummaryPanel.GroupByFunctionCheckBox.CheckedChanged += new EventHandler(GroupByFunctionCheckBox_CheckedChanged);
m_oSummaryPanel.HideCMCCheckBox.CheckedChanged += new EventHandler(HideCMCCheckBox_CheckedChanged);
+ ///
+ /// Tree view
+ ///
+ m_oSummaryPanel.PopulationTreeView.KeyPress += new KeyPressEventHandler(PopulationTreeView_Input);
+ m_oSummaryPanel.PopulationTreeView.MouseClick += new MouseEventHandler(PopulationTreeView_Input);
///
/// Time Advancement Buttons:
@@ -165,9 +202,25 @@ private void HideCMCCheckBox_CheckedChanged(object sender, EventArgs e)
BuildTreeView();
}
+ ///
+ /// Tree view input handling
+ ///
+ ///
+ ///
+ private void PopulationTreeView_Input(object sender, EventArgs e)
+ {
+ if( m_oSummaryPanel.PopulationTreeView.SelectedNode != null)
+ {
+ if (TreeViewDictionary.ContainsKey(m_oSummaryPanel.PopulationTreeView.SelectedNode.Name) == true)
+ {
+ m_oCurrnetPopulation = TreeViewDictionary[m_oSummaryPanel.PopulationTreeView.SelectedNode.Name];
+ }
+ }
+ }
+
#region Time Advancement Buttons
///
- /// Function to advance time for all buttons.
+ /// Function to advance time for all buttons. this is all lifted from the system map time code.
///
///
private void AdvanceTime(int TickValue)
@@ -316,6 +369,8 @@ private void RefreshPanels()
if (m_oCurrnetFaction != null)
{
BuildTreeView();
+
+ RefreshSummaryCells();
}
}
@@ -325,6 +380,8 @@ private void RefreshPanels()
///
private void BuildTreeView()
{
+ TreeViewDictionary.Clear();
+
Dictionary SystemPopulation = new Dictionary();
m_oSummaryPanel.PopulationTreeView.Nodes.Clear();
@@ -380,6 +437,8 @@ private void BuildTreeView()
int DisplayIndex = 0;
int CurrentSystemIndex = m_oSummaryPanel.PopulationTreeView.Nodes[DisplayIndex].Nodes.IndexOfKey(CurrentSystem.Name);
m_oSummaryPanel.PopulationTreeView.Nodes[DisplayIndex].Nodes[CurrentSystemIndex].Nodes.Add(Entry, Entry);
+
+ TreeViewDictionary.Add(Entry, Pop);
}
///
/// Automining colony will only mine, but may have CMCs listening posts, terraforming gear and ruins
@@ -394,6 +453,8 @@ private void BuildTreeView()
int DisplayIndex = 1;
int CurrentSystemIndex = m_oSummaryPanel.PopulationTreeView.Nodes[DisplayIndex].Nodes.IndexOfKey(CurrentSystem.Name);
m_oSummaryPanel.PopulationTreeView.Nodes[DisplayIndex].Nodes[CurrentSystemIndex].Nodes.Add(Entry, Entry);
+
+ TreeViewDictionary.Add(Entry, Pop);
}
///
/// CMCs. don't print this one if they should be hidden(by user input request). will also have a DSTS(or should I roll that into the CMC?), and may have terraforming and ruins)
@@ -409,6 +470,8 @@ private void BuildTreeView()
int CurrentSystemIndex = m_oSummaryPanel.PopulationTreeView.Nodes[DisplayIndex].Nodes.IndexOfKey(CurrentSystem.Name);
m_oSummaryPanel.PopulationTreeView.Nodes[DisplayIndex].Nodes[CurrentSystemIndex].Nodes.Add(Entry, Entry);
+ TreeViewDictionary.Add(Entry, Pop);
+
}
///
/// Listening Post. will have DSTS, and maybe terraforming or ruins.
@@ -425,12 +488,14 @@ private void BuildTreeView()
DisplayIndex = 3;
int CurrentSystemIndex = m_oSummaryPanel.PopulationTreeView.Nodes[DisplayIndex].Nodes.IndexOfKey(CurrentSystem.Name);
m_oSummaryPanel.PopulationTreeView.Nodes[DisplayIndex].Nodes[CurrentSystemIndex].Nodes.Add(Entry, Entry);
+
+ TreeViewDictionary.Add(Entry, Pop);
}
///
/// Archeological Dig. will have ruins, and may have orbital terraforming.
///
- else if (Pop.Planet.PlanetaryRuins != null)
+ else if (Pop.Planet.PlanetaryRuins.RuinSize != Ruins.RSize.NoRuins)
{
Class = String.Format(" Archeological Dig");
@@ -441,6 +506,8 @@ private void BuildTreeView()
DisplayIndex = 4;
int CurrentSystemIndex = m_oSummaryPanel.PopulationTreeView.Nodes[DisplayIndex].Nodes.IndexOfKey(CurrentSystem.Name);
m_oSummaryPanel.PopulationTreeView.Nodes[DisplayIndex].Nodes[CurrentSystemIndex].Nodes.Add(Entry, Entry);
+
+ TreeViewDictionary.Add(Entry, Pop);
}
///
/// Orbital Terraforming modules. a planet with ships in orbit that will terraform it.
@@ -456,6 +523,8 @@ private void BuildTreeView()
DisplayIndex = 5;
int CurrentSystemIndex = m_oSummaryPanel.PopulationTreeView.Nodes[DisplayIndex].Nodes.IndexOfKey(CurrentSystem.Name);
m_oSummaryPanel.PopulationTreeView.Nodes[DisplayIndex].Nodes[CurrentSystemIndex].Nodes.Add(Entry, Entry);
+
+ TreeViewDictionary.Add(Entry, Pop);
}
else
{
@@ -471,6 +540,8 @@ private void BuildTreeView()
DisplayIndex = 6;
int CurrentSystemIndex = m_oSummaryPanel.PopulationTreeView.Nodes[DisplayIndex].Nodes.IndexOfKey(CurrentSystem.Name);
m_oSummaryPanel.PopulationTreeView.Nodes[DisplayIndex].Nodes[CurrentSystemIndex].Nodes.Add(Entry, Entry);
+
+ TreeViewDictionary.Add(Entry, Pop);
}
}
}
@@ -489,7 +560,7 @@ private void BuildTreeView()
/// What type of colony is this, and should it be placed into the tree view(no if CMC and CMC are hidden)
///
String Class = "";
- bool print = true;
+ bool CMCPrintControl = true;
///
/// Populated colony, can do basically anything
@@ -524,7 +595,7 @@ private void BuildTreeView()
Class = String.Format(": {0}x Civ Mines", mines);
if(m_oSummaryPanel.HideCMCCheckBox.Checked == true)
- print = false;
+ CMCPrintControl = false;
}
///
/// Listening Post. will have DSTS, and maybe terraforming or ruins.
@@ -538,7 +609,7 @@ private void BuildTreeView()
///
/// Archeological Dig. will have ruins, and may have orbital terraforming.
///
- else if(Pop.Planet.PlanetaryRuins != null)
+ else if(Pop.Planet.PlanetaryRuins.RuinSize != Ruins.RSize.NoRuins)
{
Class = String.Format(" Archeological Dig");
}
@@ -552,12 +623,18 @@ private void BuildTreeView()
///
/// If none of the above are true, then the colony is simply dropped into the other colonies category, though that isn't important here.
+ /// Don't print if this is a CMC and CMC are hidden.
///
-
- String Entry = String.Format("{0} - {1}{2}", Pop.Name, Pop.Species.Name, Class);
-
- int CurrentSystemIndex = m_oSummaryPanel.PopulationTreeView.Nodes[0].Nodes.IndexOfKey(CurrentSystem.Name);
- m_oSummaryPanel.PopulationTreeView.Nodes[0].Nodes[CurrentSystemIndex].Nodes.Add(Entry, Entry);
+
+ if (CMCPrintControl == true)
+ {
+ String Entry = String.Format("{0} - {1}{2}", Pop.Name, Pop.Species.Name, Class);
+
+ int CurrentSystemIndex = m_oSummaryPanel.PopulationTreeView.Nodes[0].Nodes.IndexOfKey(CurrentSystem.Name);
+ m_oSummaryPanel.PopulationTreeView.Nodes[0].Nodes[CurrentSystemIndex].Nodes.Add(Entry, Entry);
+
+ TreeViewDictionary.Add(Entry, Pop);
+ }
}
}
@@ -578,6 +655,7 @@ private void BuildTreeView()
m_oSummaryPanel.PopulationTreeView.Nodes[0].ExpandAll();
}
+#region Industrial Summary
private void SetupSummaryDataGrid()
{
try
@@ -630,7 +708,7 @@ private void SetupSummaryDataGrid()
}
// Add Rows:
- for (int i = 0; i < 33; ++i)
+ for (int i = 0; i < 38; ++i)
{
using (DataGridViewRow row = new DataGridViewRow())
{
@@ -640,47 +718,120 @@ private void SetupSummaryDataGrid()
}
}
- // Setup item Colomn:
- m_oSummaryPanel.SummaryDataGrid.Rows[1].Cells[0].Value = "Species";
- m_oSummaryPanel.SummaryDataGrid.Rows[7].Cells[0].Value = "Population";
- m_oSummaryPanel.SummaryDataGrid.Rows[8].Cells[0].Value = " Agriculture and Enviromental (5.0%)";
- m_oSummaryPanel.SummaryDataGrid.Rows[9].Cells[0].Value = " Service Industries (75.0%)";
+ ///
+ /// General Colony Information
+ ///
+ m_oSummaryPanel.SummaryDataGrid.Rows[0].Cells[0].Value = "Political Status";
+ m_oSummaryPanel.SummaryDataGrid.Rows[1].Cells[0].Value = "Species";
+ m_oSummaryPanel.SummaryDataGrid.Rows[2].Cells[0].Value = "Planetary Suitability(colony cost)";
+ m_oSummaryPanel.SummaryDataGrid.Rows[3].Cells[0].Value = "Administration Level Required";
+
+ ///
+ /// Wealth = Population * wealth tech
+ ///
+ m_oSummaryPanel.SummaryDataGrid.Rows[5].Cells[0].Value = "Annual Wealth Creation";
+
+ ///
+ /// Population Breakdown
+ ///
+ m_oSummaryPanel.SummaryDataGrid.Rows[7].Cells[0].Value = "Population";
+ m_oSummaryPanel.SummaryDataGrid.Rows[8].Cells[0].Value = " Agriculture and Enviromental (5.0%)";
+ m_oSummaryPanel.SummaryDataGrid.Rows[9].Cells[0].Value = " Service Industries (75.0%)";
m_oSummaryPanel.SummaryDataGrid.Rows[10].Cells[0].Value = " Manufacturing (20.0%)";
m_oSummaryPanel.SummaryDataGrid.Rows[11].Cells[0].Value = "Anual Growth Rate";
+ ///
+ /// Infrastructure information.
+ ///
+ m_oSummaryPanel.SummaryDataGrid.Rows[13].Cells[0].Value = "Infrastructure Required per Million Population";
m_oSummaryPanel.SummaryDataGrid.Rows[14].Cells[0].Value = "Current Infrastructure";
-
- m_oSummaryPanel.SummaryDataGrid.Rows[31].Cells[0].Value = "Tectonics";
-
- // Setup Installation Colomn
- m_oSummaryPanel.SummaryDataGrid.Rows[0].Cells[2].Value = "Military Academy";
- m_oSummaryPanel.SummaryDataGrid.Rows[1].Cells[2].Value = "Deep Space Tracking Station";
- m_oSummaryPanel.SummaryDataGrid.Rows[2].Cells[2].Value = "Maintenance Facility Maximum Ship Size";
-
- m_oSummaryPanel.SummaryDataGrid.Rows[4].Cells[2].Value = "Shipyards / Slipways";
- m_oSummaryPanel.SummaryDataGrid.Rows[5].Cells[2].Value = "Maintenance Facilities";
- m_oSummaryPanel.SummaryDataGrid.Rows[6].Cells[2].Value = "Construction Factories";
- m_oSummaryPanel.SummaryDataGrid.Rows[7].Cells[2].Value = "Ordnance Factories";
- m_oSummaryPanel.SummaryDataGrid.Rows[8].Cells[2].Value = "Fighter Factories";
- m_oSummaryPanel.SummaryDataGrid.Rows[9].Cells[2].Value = "Fuel Refineries";
- m_oSummaryPanel.SummaryDataGrid.Rows[10].Cells[2].Value = "Mines";
- m_oSummaryPanel.SummaryDataGrid.Rows[11].Cells[2].Value = "Automated Mines";
- m_oSummaryPanel.SummaryDataGrid.Rows[12].Cells[2].Value = "Research Labs";
- m_oSummaryPanel.SummaryDataGrid.Rows[13].Cells[2].Value = "Ground Force Training Facilities";
- m_oSummaryPanel.SummaryDataGrid.Rows[14].Cells[2].Value = "Financial Centre";
- m_oSummaryPanel.SummaryDataGrid.Rows[15].Cells[2].Value = "Mass Driver";
- m_oSummaryPanel.SummaryDataGrid.Rows[16].Cells[2].Value = "Sector Command";
- m_oSummaryPanel.SummaryDataGrid.Rows[17].Cells[2].Value = "Spaceport";
- m_oSummaryPanel.SummaryDataGrid.Rows[18].Cells[2].Value = "Terraforming Installation";
-
- m_oSummaryPanel.SummaryDataGrid.Rows[20].Cells[2].Value = "Fuel Reserves";
- m_oSummaryPanel.SummaryDataGrid.Rows[21].Cells[2].Value = "Maintenance Supplies";
- m_oSummaryPanel.SummaryDataGrid.Rows[23].Cells[2].Value = "EM Signature of Colony";
- m_oSummaryPanel.SummaryDataGrid.Rows[25].Cells[2].Value = "Economic Production Modifier";
- m_oSummaryPanel.SummaryDataGrid.Rows[26].Cells[2].Value = "Manufacturing Efficiency Modifier";
- m_oSummaryPanel.SummaryDataGrid.Rows[27].Cells[2].Value = "Political Status Production Modifier";
- m_oSummaryPanel.SummaryDataGrid.Rows[28].Cells[2].Value = "Political Status Wealth/Trade Modifier";
- m_oSummaryPanel.SummaryDataGrid.Rows[29].Cells[2].Value = "Political Status Modifier";
+ m_oSummaryPanel.SummaryDataGrid.Rows[15].Cells[0].Value = "Population supported by Infrastructure";
+
+ ///
+ /// Manufacturing Sector Population Usage
+ ///
+ m_oSummaryPanel.SummaryDataGrid.Rows[17].Cells[0].Value = "Manufacturing Sector Breakdown";
+ m_oSummaryPanel.SummaryDataGrid.Rows[18].Cells[0].Value = "Shipyard Workers";
+ m_oSummaryPanel.SummaryDataGrid.Rows[19].Cells[0].Value = "Maintenance Workers";
+ m_oSummaryPanel.SummaryDataGrid.Rows[20].Cells[0].Value = "Construction Workers";
+ m_oSummaryPanel.SummaryDataGrid.Rows[21].Cells[0].Value = "Ordnance Factory Workers";
+ m_oSummaryPanel.SummaryDataGrid.Rows[22].Cells[0].Value = "Fighter Factory Workers";
+ m_oSummaryPanel.SummaryDataGrid.Rows[23].Cells[0].Value = "Fuel Refinery Workers";
+ m_oSummaryPanel.SummaryDataGrid.Rows[24].Cells[0].Value = "Financial Centre Workers";
+ m_oSummaryPanel.SummaryDataGrid.Rows[25].Cells[0].Value = "Mine Workers";
+ m_oSummaryPanel.SummaryDataGrid.Rows[26].Cells[0].Value = "Terraformers";
+ m_oSummaryPanel.SummaryDataGrid.Rows[27].Cells[0].Value = "Scientists";
+ m_oSummaryPanel.SummaryDataGrid.Rows[28].Cells[0].Value = "Available Workers";
+
+ ///
+ /// Protection
+ ///
+ m_oSummaryPanel.SummaryDataGrid.Rows[30].Cells[0].Value = "Requested Protection Level";
+ m_oSummaryPanel.SummaryDataGrid.Rows[31].Cells[0].Value = "Actual Protection Level";
+
+ ///
+ /// Planetary Geology
+ ///
+ m_oSummaryPanel.SummaryDataGrid.Rows[33].Cells[0].Value = "Tectonics";
+ m_oSummaryPanel.SummaryDataGrid.Rows[34].Cells[0].Value = "Geological Team Survey Completed";
+
+ ///
+ /// Ruins
+ ///
+ m_oSummaryPanel.SummaryDataGrid.Rows[0].Cells[2].Value = "Abandoned Installations";
+ m_oSummaryPanel.SummaryDataGrid.Rows[0].Cells[3].Value = "??";
+ m_oSummaryPanel.SummaryDataGrid.Rows[1].Cells[2].Value = "(Unknown Race - Xenologist Team Required)";
+
+ ///
+ /// Global Colony Installations
+ ///
+ m_oSummaryPanel.SummaryDataGrid.Rows[3].Cells[2].Value = "Sector Command HQ";
+ m_oSummaryPanel.SummaryDataGrid.Rows[4].Cells[2].Value = "Commerical Spaceport";
+ m_oSummaryPanel.SummaryDataGrid.Rows[5].Cells[2].Value = "Military Academy";
+ m_oSummaryPanel.SummaryDataGrid.Rows[6].Cells[2].Value = "Deep Space Tracking Station";
+ m_oSummaryPanel.SummaryDataGrid.Rows[7].Cells[2].Value = "Annual Genetic Conversion Rate";
+ m_oSummaryPanel.SummaryDataGrid.Rows[8].Cells[2].Value = "Maintenance Facility Maximum Ship Size";
+ m_oSummaryPanel.SummaryDataGrid.Rows[9].Cells[2].Value = "Mass Driver Capacity";
+
+ ///
+ /// Industrial Colony Installations
+ ///
+ m_oSummaryPanel.SummaryDataGrid.Rows[11].Cells[2].Value = "Shipyards / Slipways";
+ m_oSummaryPanel.SummaryDataGrid.Rows[12].Cells[2].Value = "Maintenance Facilities";
+ m_oSummaryPanel.SummaryDataGrid.Rows[13].Cells[2].Value = "Construction Factories";
+ m_oSummaryPanel.SummaryDataGrid.Rows[14].Cells[2].Value = "Conventional Industry";
+ m_oSummaryPanel.SummaryDataGrid.Rows[15].Cells[2].Value = "Ordnance Factories";
+ m_oSummaryPanel.SummaryDataGrid.Rows[16].Cells[2].Value = "Fighter Factories";
+ m_oSummaryPanel.SummaryDataGrid.Rows[17].Cells[2].Value = "Fuel Refineries";
+ m_oSummaryPanel.SummaryDataGrid.Rows[18].Cells[2].Value = "Mines";
+ m_oSummaryPanel.SummaryDataGrid.Rows[19].Cells[2].Value = "Automated Mines";
+ m_oSummaryPanel.SummaryDataGrid.Rows[20].Cells[2].Value = "Mass Drivers";
+ m_oSummaryPanel.SummaryDataGrid.Rows[21].Cells[2].Value = "Terraforming Installation";
+ m_oSummaryPanel.SummaryDataGrid.Rows[22].Cells[2].Value = "Research Labs";
+ m_oSummaryPanel.SummaryDataGrid.Rows[23].Cells[2].Value = "Gene Modification Centers";
+ m_oSummaryPanel.SummaryDataGrid.Rows[24].Cells[2].Value = "Financial Centre";
+ m_oSummaryPanel.SummaryDataGrid.Rows[25].Cells[2].Value = "Ground Force Training Facilities";
+
+ ///
+ /// Colony Supplies
+ ///
+ m_oSummaryPanel.SummaryDataGrid.Rows[27].Cells[2].Value = "Fuel Reserves";
+ m_oSummaryPanel.SummaryDataGrid.Rows[28].Cells[2].Value = "Maintenance Supplies";
+
+ ///
+ /// Colony Detection Characteristics
+ ///
+ m_oSummaryPanel.SummaryDataGrid.Rows[30].Cells[2].Value = "Thermal Signature of Colony";
+ m_oSummaryPanel.SummaryDataGrid.Rows[31].Cells[2].Value = "EM Signature of Colony";
+
+ ///
+ /// Colony Modifiers
+ ///
+ m_oSummaryPanel.SummaryDataGrid.Rows[33].Cells[2].Value = "Economic Production Modifier";
+ m_oSummaryPanel.SummaryDataGrid.Rows[34].Cells[2].Value = "Manufacturing Efficiency Modifier";
+ m_oSummaryPanel.SummaryDataGrid.Rows[35].Cells[2].Value = "Political Status Production Modifier";
+ m_oSummaryPanel.SummaryDataGrid.Rows[36].Cells[2].Value = "Political Status Wealth/Trade Modifier";
+ m_oSummaryPanel.SummaryDataGrid.Rows[37].Cells[2].Value = "Political Status Modifier";
}
catch
{
@@ -694,46 +845,611 @@ public void RefreshSummaryCells()
{
try
{
- m_oSummaryPanel.SummaryDataGrid.ClearSelection();
- m_oSummaryPanel.SummaryDataGrid.Rows[1].Cells[1].Value = VM.CurrentFaction.Species.Name;
- m_oSummaryPanel.SummaryDataGrid.Rows[7].Cells[1].Value = VM.CurrentPopulation.CivilianPopulation.ToString() + "m";
- m_oSummaryPanel.SummaryDataGrid.Rows[8].Cells[1].Value = VM.CurrentPopulation.PopulationWorkingInAgriAndEnviro.ToString() + "m";
- m_oSummaryPanel.SummaryDataGrid.Rows[9].Cells[1].Value = VM.CurrentPopulation.PopulationWorkingInServiceIndustries.ToString() + "m";
- m_oSummaryPanel.SummaryDataGrid.Rows[10].Cells[1].Value = VM.CurrentPopulation.PopulationWorkingInManufacturing.ToString() + "m";
- m_oSummaryPanel.SummaryDataGrid.Rows[11].Cells[1].Value = VM.CurrentPopulation.PopulationGrowthRate.ToString() + "%";
-
- m_oSummaryPanel.SummaryDataGrid.Rows[14].Cells[1].Value = VM.CurrentPopulation.Installations[(int)Installation.InstallationType.Infrastructure].Number.ToString();
-
- //m_oSummaryPanel.SummaryDataGrid.Rows[31].Cells[1].Value = VM.CurrentPopulation.Planet.; - No tetonics???
- m_oSummaryPanel.SummaryDataGrid.Rows[0].Cells[3].Value = "Level " + VM.CurrentPopulation.Installations[(int)Installation.InstallationType.MilitaryAcademy].Number.ToString();
- m_oSummaryPanel.SummaryDataGrid.Rows[1].Cells[3].Value = "Level " + VM.CurrentPopulation.Installations[(int)Installation.InstallationType.DeepSpaceTrackingStation].Number.ToString();
- m_oSummaryPanel.SummaryDataGrid.Rows[2].Cells[3].Value = (VM.CurrentPopulation.Installations[(int)Installation.InstallationType.MaintenanceFacility].Number * 200).ToString() + " tons";
-
- int iShipyards = (int)(VM.CurrentPopulation.Installations[(int)Installation.InstallationType.CommercialShipyard].Number + VM.CurrentPopulation.Installations[(int)Installation.InstallationType.NavalShipyardComplex].Number);
- m_oSummaryPanel.SummaryDataGrid.Rows[4].Cells[3].Value = iShipyards.ToString() + " / ";
- m_oSummaryPanel.SummaryDataGrid.Rows[5].Cells[3].Value = VM.CurrentPopulation.Installations[(int)Installation.InstallationType.MaintenanceFacility].Number.ToString();
- m_oSummaryPanel.SummaryDataGrid.Rows[6].Cells[3].Value = VM.CurrentPopulation.Installations[(int)Installation.InstallationType.ConstructionFactory].Number.ToString();
- m_oSummaryPanel.SummaryDataGrid.Rows[7].Cells[3].Value = VM.CurrentPopulation.Installations[(int)Installation.InstallationType.OrdnanceFactory].Number.ToString();
- m_oSummaryPanel.SummaryDataGrid.Rows[8].Cells[3].Value = VM.CurrentPopulation.Installations[(int)Installation.InstallationType.FighterFactory].Number.ToString();
- m_oSummaryPanel.SummaryDataGrid.Rows[9].Cells[3].Value = VM.CurrentPopulation.Installations[(int)Installation.InstallationType.FuelRefinery].Number.ToString();
- m_oSummaryPanel.SummaryDataGrid.Rows[10].Cells[3].Value = VM.CurrentPopulation.Installations[(int)Installation.InstallationType.Mine].Number.ToString();
- m_oSummaryPanel.SummaryDataGrid.Rows[11].Cells[3].Value = VM.CurrentPopulation.Installations[(int)Installation.InstallationType.AutomatedMine].Number.ToString();
- m_oSummaryPanel.SummaryDataGrid.Rows[12].Cells[3].Value = VM.CurrentPopulation.Installations[(int)Installation.InstallationType.ResearchLab].Number.ToString();
- m_oSummaryPanel.SummaryDataGrid.Rows[13].Cells[3].Value = VM.CurrentPopulation.Installations[(int)Installation.InstallationType.GroundForceTrainingFacility].Number.ToString();
- m_oSummaryPanel.SummaryDataGrid.Rows[14].Cells[3].Value = VM.CurrentPopulation.Installations[(int)Installation.InstallationType.FinancialCentre].Number.ToString();
- m_oSummaryPanel.SummaryDataGrid.Rows[15].Cells[3].Value = VM.CurrentPopulation.Installations[(int)Installation.InstallationType.MassDriver].Number.ToString();
- m_oSummaryPanel.SummaryDataGrid.Rows[16].Cells[3].Value = VM.CurrentPopulation.Installations[(int)Installation.InstallationType.SectorCommand].Number.ToString();
- m_oSummaryPanel.SummaryDataGrid.Rows[17].Cells[3].Value = VM.CurrentPopulation.Installations[(int)Installation.InstallationType.Spaceport].Number.ToString();
- m_oSummaryPanel.SummaryDataGrid.Rows[18].Cells[3].Value = VM.CurrentPopulation.Installations[(int)Installation.InstallationType.TerraformingInstallation].Number.ToString();
-
- m_oSummaryPanel.SummaryDataGrid.Rows[20].Cells[3].Value = VM.CurrentPopulation.FuelStockpile.ToString();
- m_oSummaryPanel.SummaryDataGrid.Rows[21].Cells[3].Value = VM.CurrentPopulation.MaintenanceSupplies.ToString();
- m_oSummaryPanel.SummaryDataGrid.Rows[23].Cells[3].Value = VM.CurrentPopulation.EMSignature.ToString();
- m_oSummaryPanel.SummaryDataGrid.Rows[25].Cells[3].Value = (VM.CurrentPopulation.ModifierEconomicProduction * 100).ToString() + "%";
- m_oSummaryPanel.SummaryDataGrid.Rows[26].Cells[3].Value = (VM.CurrentPopulation.ModifierManfacturing * 100).ToString() + "%";
- m_oSummaryPanel.SummaryDataGrid.Rows[27].Cells[3].Value = (VM.CurrentPopulation.ModifierProduction * 100).ToString() + "%";
- m_oSummaryPanel.SummaryDataGrid.Rows[28].Cells[3].Value = (VM.CurrentPopulation.ModifierWealthAndTrade * 100).ToString() + "%";
- m_oSummaryPanel.SummaryDataGrid.Rows[29].Cells[3].Value = (VM.CurrentPopulation.ModifierPoliticalStability * 100).ToString() + "%";
+ if (CurrentPopulation != null)
+ {
+
+ ///
+ /// Items should not be displayed if the population in question does not have them. Adjust variables control this.
+ ///
+ int Adjust1 = 0, Adjust2 = 0;
+
+ float TotalWorkerReq = 0.0f;
+
+ m_oSummaryPanel.SummaryDataGrid.ClearSelection();
+
+ ///
+ /// General Colony Information
+ ///
+ m_oSummaryPanel.SummaryDataGrid.Rows[0].Cells[1].Value = CurrentPopulation.PoliticalPopStatus.ToString() + " Population" ;
+ m_oSummaryPanel.SummaryDataGrid.Rows[1].Cells[1].Value = CurrentPopulation.Species.Name;
+
+ // need planetary hab rating vs species tolerance
+ double ColCost = CurrentPopulation.Species.ColonyCost(CurrentPopulation.Planet);
+
+ m_oSummaryPanel.SummaryDataGrid.Rows[2].Cells[1].Value = ColCost.ToString();
+ m_oSummaryPanel.SummaryDataGrid.Rows[3].Cells[1].Value = CurrentPopulation.AdminRating;
+
+ ///
+ /// Wealth Creation
+ ///
+ int Expand = CurrentFaction.FactionTechLevel[(int)Faction.FactionTechnology.ExpandCivilianEconomy];
+ if (Expand > 12)
+ Expand = 12;
+ double Wealth = CurrentPopulation.CivilianPopulation * Expand * 20.0;
+ m_oSummaryPanel.SummaryDataGrid.Rows[5].Cells[1].Value = Wealth.ToString();
+
+ ///
+ /// Population Breakdown
+ ///
+ String Entry = String.Format("{0:N2}m", CurrentPopulation.CivilianPopulation);
+ m_oSummaryPanel.SummaryDataGrid.Rows[7].Cells[1].Value = Entry;
+
+ if (CurrentPopulation.CivilianPopulation != 0.0f)
+ {
+ Entry = String.Format(" Agriculture and Enviromental ({0:N2}%)", CurrentPopulation.PopulationWorkingInAgriAndEnviro / CurrentPopulation.CivilianPopulation);
+ m_oSummaryPanel.SummaryDataGrid.Rows[8].Cells[0].Value = Entry;
+ Entry = String.Format(" Service Industries ({0:N2}%)", CurrentPopulation.PopulationWorkingInServiceIndustries / CurrentPopulation.CivilianPopulation);
+ m_oSummaryPanel.SummaryDataGrid.Rows[9].Cells[0].Value = Entry;
+ Entry = String.Format(" Manufacturing ({0:N2}%)", CurrentPopulation.PopulationWorkingInManufacturing / CurrentPopulation.CivilianPopulation);
+ m_oSummaryPanel.SummaryDataGrid.Rows[10].Cells[0].Value = Entry;
+ m_oSummaryPanel.SummaryDataGrid.Rows[11].Cells[0].Value = "Annual Growth Rate";
+
+ Entry = String.Format("{0:N2}m", CurrentPopulation.PopulationWorkingInAgriAndEnviro);
+ m_oSummaryPanel.SummaryDataGrid.Rows[8].Cells[1].Value = Entry;
+ Entry = String.Format("{0:N2}m", CurrentPopulation.PopulationWorkingInServiceIndustries);
+ m_oSummaryPanel.SummaryDataGrid.Rows[9].Cells[1].Value = Entry;
+ Entry = String.Format("{0:N2}m", CurrentPopulation.PopulationWorkingInManufacturing);
+ m_oSummaryPanel.SummaryDataGrid.Rows[10].Cells[1].Value = Entry;
+ m_oSummaryPanel.SummaryDataGrid.Rows[11].Cells[1].Value = CurrentPopulation.PopulationGrowthRate.ToString() + "%";
+
+ Adjust1 = 5;
+ }
+ ///
+ /// Infrastructure information.
+ ///
+ m_oSummaryPanel.SummaryDataGrid.Rows[8 + Adjust1].Cells[1].Value = (ColCost * 200.0).ToString();
+ m_oSummaryPanel.SummaryDataGrid.Rows[9 + Adjust1].Cells[1].Value = CurrentPopulation.Installations[(int)Installation.InstallationType.Infrastructure].Number.ToString();
+
+ if (ColCost != 0.0f)
+ m_oSummaryPanel.SummaryDataGrid.Rows[10+Adjust1].Cells[1].Value = (CurrentPopulation.Installations[(int)Installation.InstallationType.Infrastructure].Number / (ColCost * 200.0)).ToString();
+ else
+ m_oSummaryPanel.SummaryDataGrid.Rows[10 + Adjust1].Cells[1].Value = "No Maximum";
+
+ if (CurrentPopulation.CivilianPopulation != 0.0f)
+ {
+ m_oSummaryPanel.SummaryDataGrid.Rows[12 + Adjust1].Cells[0].Value = "Manufacturing Sector Breakdown";
+
+ Adjust1++;
+ }
+
+ ///
+ /// Manufacturing Sector Population Usage
+ ///
+
+ int iShipyards = (int)(CurrentPopulation.Installations[(int)Installation.InstallationType.CommercialShipyard].Number + CurrentPopulation.Installations[(int)Installation.InstallationType.NavalShipyardComplex].Number);
+
+#warning Magic numbers here for worker calculations
+ float ShipyardWorkers = 1000000.0f * iShipyards;
+
+ int iSlipways = 0;
+ for (int CSYIterator = 0; CSYIterator < (int)CurrentPopulation.Installations[(int)Installation.InstallationType.CommercialShipyard].Number; CSYIterator++)
+ {
+ int slips = CurrentPopulation.Installations[(int)Installation.InstallationType.CommercialShipyard].Slipways[CSYIterator];
+ int tons = CurrentPopulation.Installations[(int)Installation.InstallationType.CommercialShipyard].Tonnage[CSYIterator];
+ iSlipways = iSlipways + slips;
+
+ ///
+ /// Manpower requirement = 1,000,000 + num_slipways * capacity_per_slipway_in_tons * 100 / DIVISOR. DIVISOR is 1 for military yards and 10 for commercial yards. Thus, the flat 1,000,000 manpower required is not reduced for commercial yards, only the capacity-based component.
+ ///
+ ShipyardWorkers = ShipyardWorkers + (slips * tons * 100 / 10);
+ }
+
+ for (int NSYIterator = 0; NSYIterator < (int)CurrentPopulation.Installations[(int)Installation.InstallationType.NavalShipyardComplex].Number; NSYIterator++)
+ {
+ int slips = CurrentPopulation.Installations[(int)Installation.InstallationType.NavalShipyardComplex].Slipways[NSYIterator];
+ int tons = CurrentPopulation.Installations[(int)Installation.InstallationType.NavalShipyardComplex].Tonnage[NSYIterator];
+ iSlipways = iSlipways + CurrentPopulation.Installations[(int)Installation.InstallationType.NavalShipyardComplex].Slipways[NSYIterator];
+
+ ///
+ /// Manpower requirement = 1,000,000 + num_slipways * capacity_per_slipway_in_tons * 100 / DIVISOR. DIVISOR is 1 for military yards and 10 for commercial yards. Thus, the flat 1,000,000 manpower required is not reduced for commercial yards, only the capacity-based component.
+ ///
+ ShipyardWorkers = ShipyardWorkers + (slips * tons * 100 / 1);
+ }
+
+ ///
+ /// Ruins
+ ///
+ if (CurrentPopulation.Planet.PlanetaryRuins.RuinSize != Ruins.RSize.NoRuins)
+ {
+#warning handle Ruins here
+ m_oSummaryPanel.SummaryDataGrid.Rows[0].Cells[2].Value = "Abandoned Installations";
+ m_oSummaryPanel.SummaryDataGrid.Rows[0].Cells[3].Value = "??";
+ m_oSummaryPanel.SummaryDataGrid.Rows[1].Cells[2].Value = "(Unknown Race - Xenologist Team Required)";
+ m_oSummaryPanel.SummaryDataGrid.Rows[1].Cells[3].Value = "";
+ Adjust2 = 3;
+ }
+
+ ///
+ /// Sector Command
+ ///
+ if (CurrentPopulation.Installations[(int)Installation.InstallationType.SectorCommand].Number >= 1.0f)
+ {
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[2].Value = "Sector Command HQ";
+ float radius = (float)Math.Floor(Math.Sqrt((double)Math.Floor(CurrentPopulation.Installations[(int)Installation.InstallationType.SectorCommand].Number)));
+ Entry = String.Format("Level {0} (Radius {1})", Math.Floor(CurrentPopulation.Installations[(int)Installation.InstallationType.SectorCommand].Number), radius);
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[3].Value = Entry;
+
+ Adjust2++;
+ }
+
+ ///
+ /// Commercial Spaceport
+ /// = 1.0f)
+ {
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[2].Value = "Commerical Spaceport";
+ Entry = String.Format("Level {0}", Math.Floor(CurrentPopulation.Installations[(int)Installation.InstallationType.Spaceport].Number));
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[3].Value = Entry;
+
+ Adjust2++;
+ }
+
+ ///
+ /// Military Academy
+ /// = 1.0f)
+ {
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[2].Value = "Military Academy";
+ Entry = String.Format("Level {0}", Math.Floor(CurrentPopulation.Installations[(int)Installation.InstallationType.MilitaryAcademy].Number));
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[3].Value = Entry;
+
+ Adjust2++;
+ }
+
+ ///
+ /// Deep Space Tracking Station
+ /// = 1.0f)
+ {
+ int DSTS = CurrentFaction.FactionTechLevel[(int)Faction.FactionTechnology.DSTSSensorStrength];
+ if (DSTS > Constants.Colony.DeepSpaceMax)
+ DSTS = Constants.Colony.DeepSpaceMax;
+
+ int Strength = (int)Math.Floor(CurrentPopulation.Installations[(int)Installation.InstallationType.DeepSpaceTrackingStation].Number) * Constants.Colony.DeepSpaceStrength[DSTS];
+ Entry = String.Format("Deep Space Tracking Station - Strength {0}", Strength);
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[2].Value = Entry;
+ Entry = String.Format("Level {0}", Math.Floor(CurrentPopulation.Installations[(int)Installation.InstallationType.DeepSpaceTrackingStation].Number));
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[3].Value = Entry;
+
+ Adjust2++;
+ }
+
+ ///
+ /// Genetic Modification Centres
+ /// = 1.0f)
+ {
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[2].Value = "Annual Genetic Conversion Rate";
+
+ float rate = 0.25f * (float)Math.Floor(CurrentPopulation.Installations[(int)Installation.InstallationType.GeneticModificationCentre].Number);
+ Entry = String.Format("{0:N2}m", rate);
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[3].Value = Entry;
+
+ Adjust2++;
+ }
+
+ ///
+ /// Maintenance Facilities
+ /// = 1.0f)
+ {
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[2].Value = "Maintenance Facility Maximum Ship Size";
+
+ float fac = 200 * (float)Math.Floor(CurrentPopulation.Installations[(int)Installation.InstallationType.MaintenanceFacility].Number);
+ Entry = String.Format("{0:n} tons", fac);
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[3].Value = Entry;
+
+ Adjust2++;
+ }
+
+ ///
+ /// Mass Drivers
+ /// = 1.0f)
+ {
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[2].Value = "Mass Driver Capacity";
+
+ float fac = 5000 * (float)Math.Floor(CurrentPopulation.Installations[(int)Installation.InstallationType.MassDriver].Number);
+ Entry = String.Format("{0:n} tons per year", fac);
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[3].Value = Entry;
+
+ Adjust2++;
+ }
+
+ ///
+ /// Don't want to print this space if there is nothing above it.
+ ///
+ if (Adjust2 != 0)
+ {
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[2].Value = "";
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[3].Value = "";
+
+ Adjust2++;
+ }
+
+ ///
+ /// Shipyards
+ ///
+ if(iShipyards != 0)
+ {
+ m_oSummaryPanel.SummaryDataGrid.Rows[12 + Adjust1].Cells[0].Value = "Shipyard Workers";
+ Entry = String.Format("{0:N2}m", (ShipyardWorkers / 1000000.0f));
+ m_oSummaryPanel.SummaryDataGrid.Rows[12 + Adjust1].Cells[1].Value = Entry;
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[2].Value = "Shipyards / Slipways";
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[3].Value = iShipyards.ToString() + " / " + iSlipways.ToString();
+
+ TotalWorkerReq = TotalWorkerReq + (ShipyardWorkers / 1000000.0f);
+
+ Adjust1++;
+ Adjust2++;
+ }
+
+ ///
+ /// Maintenance Facility Workers. This is separate from Maintenance factories above as shipyards needed to be calculated first for offset adjustment.
+ /// = 1.0f)
+ {
+ m_oSummaryPanel.SummaryDataGrid.Rows[12 + Adjust1].Cells[0].Value = "Maintenance Workers";
+
+ float workers = 0.05f * (float)Math.Floor(CurrentPopulation.Installations[(int)Installation.InstallationType.MaintenanceFacility].Number);
+ Entry = String.Format("{0:N2}m", workers);
+ m_oSummaryPanel.SummaryDataGrid.Rows[12 + Adjust1].Cells[1].Value = Entry;
+
+ TotalWorkerReq = TotalWorkerReq + workers;
+
+ Adjust1++;
+ }
+
+ ///
+ /// Construction Factories
+ ///
+ if (CurrentPopulation.Installations[(int)Installation.InstallationType.ConstructionFactory].Number >= 1.0f)
+ {
+ m_oSummaryPanel.SummaryDataGrid.Rows[12 + Adjust1].Cells[0].Value = "Construction Workers";
+ float workers = 0.05f * (float)Math.Floor(CurrentPopulation.Installations[(int)Installation.InstallationType.ConstructionFactory].Number);
+
+ ///
+ /// Conventional Industry worker adjustment.
+ ///
+ if (CurrentPopulation.Installations[(int)Installation.InstallationType.ConventionalIndustry].Number >= 1.0f)
+ {
+ workers = workers + (0.05f * (float)Math.Floor(CurrentPopulation.Installations[(int)Installation.InstallationType.ConventionalIndustry].Number));
+ }
+
+ TotalWorkerReq = TotalWorkerReq + workers;
+
+ Entry = String.Format("{0:N2}m", workers);
+ m_oSummaryPanel.SummaryDataGrid.Rows[12 + Adjust1].Cells[1].Value = Entry;
+
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[2].Value = "Construction Factories";
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[3].Value = Math.Floor(CurrentPopulation.Installations[(int)Installation.InstallationType.ConstructionFactory].Number).ToString();
+
+ Adjust1++;
+ Adjust2++;
+ }
+
+ ///
+ /// Conventional Industry
+ ///
+ if (CurrentPopulation.Installations[(int)Installation.InstallationType.ConventionalIndustry].Number >= 1.0f)
+ {
+ if (CurrentPopulation.Installations[(int)Installation.InstallationType.ConstructionFactory].Number < 1.0f)
+ {
+ m_oSummaryPanel.SummaryDataGrid.Rows[12 + Adjust1].Cells[0].Value = "Construction Workers";
+ float workers = 0.05f * (float)Math.Floor(CurrentPopulation.Installations[(int)Installation.InstallationType.ConventionalIndustry].Number);
+ Entry = String.Format("{0:N2}m", workers);
+ m_oSummaryPanel.SummaryDataGrid.Rows[12 + Adjust1].Cells[1].Value = Entry;
+
+ TotalWorkerReq = TotalWorkerReq + workers;
+
+ Adjust1++;
+ }
+
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[2].Value = "Conventional Industry";
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[3].Value = Math.Floor(CurrentPopulation.Installations[(int)Installation.InstallationType.ConventionalIndustry].Number).ToString();
+
+ Adjust2++;
+ }
+
+
+ ///
+ /// Ordnance Factories
+ ///
+ if (CurrentPopulation.Installations[(int)Installation.InstallationType.OrdnanceFactory].Number >= 1.0f)
+ {
+ m_oSummaryPanel.SummaryDataGrid.Rows[12 + Adjust1].Cells[0].Value = "Ordnance Factory Workers";
+ float workers = 0.05f * (float)Math.Floor(CurrentPopulation.Installations[(int)Installation.InstallationType.OrdnanceFactory].Number);
+
+ TotalWorkerReq = TotalWorkerReq + workers;
+
+ Entry = String.Format("{0:N2}m", workers);
+ m_oSummaryPanel.SummaryDataGrid.Rows[12 + Adjust1].Cells[1].Value = Entry;
+
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[2].Value = "Ordnance Factories";
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[3].Value = Math.Floor(CurrentPopulation.Installations[(int)Installation.InstallationType.OrdnanceFactory].Number).ToString();
+
+ Adjust1++;
+ Adjust2++;
+ }
+
+ ///
+ /// Fighter Factories
+ ///
+ if (CurrentPopulation.Installations[(int)Installation.InstallationType.FighterFactory].Number >= 1.0f)
+ {
+ m_oSummaryPanel.SummaryDataGrid.Rows[12 + Adjust1].Cells[0].Value = "Fighter Factory Workers";
+ float workers = 0.05f * (float)Math.Floor(CurrentPopulation.Installations[(int)Installation.InstallationType.FighterFactory].Number);
+
+ TotalWorkerReq = TotalWorkerReq + workers;
+
+ Entry = String.Format("{0:N2}m", workers);
+ m_oSummaryPanel.SummaryDataGrid.Rows[12 + Adjust1].Cells[1].Value = Entry;
+
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[2].Value = "Fighter Factories";
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[3].Value = Math.Floor(CurrentPopulation.Installations[(int)Installation.InstallationType.FighterFactory].Number).ToString();
+
+ Adjust1++;
+ Adjust2++;
+ }
+
+ ///
+ /// Refineries
+ ///
+ if (CurrentPopulation.Installations[(int)Installation.InstallationType.FuelRefinery].Number >= 1.0f)
+ {
+ m_oSummaryPanel.SummaryDataGrid.Rows[12 + Adjust1].Cells[0].Value = "Fuel Refinery Workers";
+ float workers = 0.05f * (float)Math.Floor(CurrentPopulation.Installations[(int)Installation.InstallationType.FuelRefinery].Number);
+
+ TotalWorkerReq = TotalWorkerReq + workers;
+
+ Entry = String.Format("{0:N2}m", workers);
+ m_oSummaryPanel.SummaryDataGrid.Rows[12 + Adjust1].Cells[1].Value = Entry;
+
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[2].Value = "Ordnance Factories";
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[3].Value = Math.Floor(CurrentPopulation.Installations[(int)Installation.InstallationType.FuelRefinery].Number).ToString();
+
+ Adjust1++;
+ Adjust2++;
+ }
+
+ ///
+ /// Financial Centre Workers
+ ///
+ if (CurrentPopulation.Installations[(int)Installation.InstallationType.FinancialCentre].Number >= 1.0f)
+ {
+ m_oSummaryPanel.SummaryDataGrid.Rows[12 + Adjust1].Cells[0].Value = "Financial Centre Workers";
+
+ float workers = 0.05f * (float)Math.Floor(CurrentPopulation.Installations[(int)Installation.InstallationType.FinancialCentre].Number);
+
+ TotalWorkerReq = TotalWorkerReq + workers;
+
+ Entry = String.Format("{0:N2}m", workers);
+ m_oSummaryPanel.SummaryDataGrid.Rows[12 + Adjust1].Cells[1].Value = Entry;
+
+ Adjust1++;
+ }
+
+ ///
+ /// mines
+ ///
+ if (CurrentPopulation.Installations[(int)Installation.InstallationType.Mine].Number >= 1.0f)
+ {
+ m_oSummaryPanel.SummaryDataGrid.Rows[12 + Adjust1].Cells[0].Value = "Mine Workers";
+ float workers = 0.05f * (float)Math.Floor(CurrentPopulation.Installations[(int)Installation.InstallationType.Mine].Number);
+
+ TotalWorkerReq = TotalWorkerReq + workers;
+
+ Entry = String.Format("{0:N2}m", workers);
+ m_oSummaryPanel.SummaryDataGrid.Rows[12 + Adjust1].Cells[1].Value = Entry;
+
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[2].Value = "Mines";
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[3].Value = Math.Floor(CurrentPopulation.Installations[(int)Installation.InstallationType.Mine].Number).ToString();
+
+ Adjust1++;
+ Adjust2++;
+ }
+
+ ///
+ /// automines
+ ///
+ if (CurrentPopulation.Installations[(int)Installation.InstallationType.AutomatedMine].Number >= 1.0f)
+ {
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[2].Value = "Automated Mines";
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[3].Value = Math.Floor(CurrentPopulation.Installations[(int)Installation.InstallationType.AutomatedMine].Number).ToString();
+
+ Adjust2++;
+ }
+
+ ///
+ /// Mass Drivers
+ ///
+ if (CurrentPopulation.Installations[(int)Installation.InstallationType.MassDriver].Number >= 1.0f)
+ {
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[2].Value = "Mass Drivers";
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[3].Value = Math.Floor(CurrentPopulation.Installations[(int)Installation.InstallationType.MassDriver].Number).ToString();
+
+ Adjust2++;
+ }
+
+ ///
+ /// Terraformers
+ ///
+ if (CurrentPopulation.Installations[(int)Installation.InstallationType.TerraformingInstallation].Number >= 1.0f)
+ {
+ m_oSummaryPanel.SummaryDataGrid.Rows[12 + Adjust1].Cells[0].Value = "Terraformers";
+ float workers = 0.25f * (float)Math.Floor(CurrentPopulation.Installations[(int)Installation.InstallationType.TerraformingInstallation].Number);
+
+ TotalWorkerReq = TotalWorkerReq + workers;
+
+ Entry = String.Format("{0:N2}m", workers);
+ m_oSummaryPanel.SummaryDataGrid.Rows[12 + Adjust1].Cells[1].Value = Entry;
+
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[2].Value = "Terraforming Installation";
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[3].Value = Math.Floor(CurrentPopulation.Installations[(int)Installation.InstallationType.TerraformingInstallation].Number).ToString();
+
+ Adjust1++;
+ Adjust2++;
+ }
+
+ ///
+ /// Research labs
+ ///
+ if (CurrentPopulation.Installations[(int)Installation.InstallationType.ResearchLab].Number >= 1.0f)
+ {
+ m_oSummaryPanel.SummaryDataGrid.Rows[12 + Adjust1].Cells[0].Value = "Scientists";
+ float workers = 1.0f * (float)Math.Floor(CurrentPopulation.Installations[(int)Installation.InstallationType.ResearchLab].Number);
+
+ TotalWorkerReq = TotalWorkerReq + workers;
+
+ Entry = String.Format("{0:N2}m", workers);
+ m_oSummaryPanel.SummaryDataGrid.Rows[12 + Adjust1].Cells[1].Value = Entry;
+
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[2].Value = "Research Labs";
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[3].Value = Math.Floor(CurrentPopulation.Installations[(int)Installation.InstallationType.ResearchLab].Number).ToString();
+
+ Adjust1++;
+ Adjust2++;
+ }
+
+ ///
+ /// Available workers
+ ///
+ if (CurrentPopulation.CivilianPopulation != 0.0f)
+ {
+ m_oSummaryPanel.SummaryDataGrid.Rows[12 + Adjust1].Cells[0].Value = "Available Workers";
+ Entry = String.Format("{0:N2}",(CurrentPopulation.PopulationWorkingInManufacturing - TotalWorkerReq));
+ m_oSummaryPanel.SummaryDataGrid.Rows[12 + Adjust1].Cells[1].Value = Entry;
+
+ Adjust1++;
+ }
+
+ ///
+ /// Protection
+ ///
+ if (CurrentPopulation.CivilianPopulation >= 10.0f)
+ {
+
+ m_oSummaryPanel.SummaryDataGrid.Rows[12 + Adjust1].Cells[0].Value = "";
+ m_oSummaryPanel.SummaryDataGrid.Rows[12 + Adjust1].Cells[1].Value = "";
+ m_oSummaryPanel.SummaryDataGrid.Rows[13 + Adjust1].Cells[0].Value = "Requested Protection Level";
+ Entry = String.Format("{0:N0}", Math.Round(CurrentPopulation.CivilianPopulation / 5.5f));
+ m_oSummaryPanel.SummaryDataGrid.Rows[13 + Adjust1].Cells[1].Value = Entry;
+ m_oSummaryPanel.SummaryDataGrid.Rows[14 + Adjust1].Cells[0].Value = "Actual Protection Level";
+ m_oSummaryPanel.SummaryDataGrid.Rows[14 + Adjust1].Cells[1].Value = CurrentPopulation.Planet.Primary.StarSystem.GetProtectionLevel(CurrentFaction).ToString();
+ Adjust1 = Adjust1 + 3;
+ }
+
+ ///
+ /// Planetary Geology
+ ///
+ m_oSummaryPanel.SummaryDataGrid.Rows[12 + Adjust1].Cells[0].Value = "";
+ m_oSummaryPanel.SummaryDataGrid.Rows[12 + Adjust1].Cells[1].Value = "";
+ m_oSummaryPanel.SummaryDataGrid.Rows[13 + Adjust1].Cells[0].Value = "Tectonics";
+ m_oSummaryPanel.SummaryDataGrid.Rows[13 + Adjust1].Cells[1].Value = CurrentPopulation.Planet.PlanetaryTectonics;
+ if (CurrentPopulation.Planet.GeoTeamSurvey == true)
+ {
+ Entry = "Completed";
+ }
+ else
+ Entry = "No";
+ m_oSummaryPanel.SummaryDataGrid.Rows[14 + Adjust1].Cells[0].Value = "Geological Team Survey Completed";
+ m_oSummaryPanel.SummaryDataGrid.Rows[14 + Adjust1].Cells[1].Value = Entry;
+
+ for (int rowIterator = (15 + Adjust1); rowIterator < 38; rowIterator++)
+ {
+ m_oSummaryPanel.SummaryDataGrid.Rows[rowIterator].Cells[0].Value = "";
+ m_oSummaryPanel.SummaryDataGrid.Rows[rowIterator].Cells[1].Value = "";
+ }
+
+ ///
+ /// Genetic Modification Centers
+ ///
+ if (CurrentPopulation.Installations[(int)Installation.InstallationType.GeneticModificationCentre].Number >= 1.0f)
+ {
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[2].Value = "Genetic Modification Centers";
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[3].Value = Math.Floor(CurrentPopulation.Installations[(int)Installation.InstallationType.GeneticModificationCentre].Number).ToString();
+
+ Adjust2++;
+ }
+
+ ///
+ /// Financial Centres
+ ///
+ if (CurrentPopulation.Installations[(int)Installation.InstallationType.FinancialCentre].Number >= 1.0f)
+ {
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[2].Value = "Financial Centre";
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[3].Value = Math.Floor(CurrentPopulation.Installations[(int)Installation.InstallationType.FinancialCentre].Number).ToString();
+
+ Adjust2++;
+ }
+
+ ///
+ /// Ground Forces Training Facilities
+ ///
+ if (CurrentPopulation.Installations[(int)Installation.InstallationType.GroundForceTrainingFacility].Number >= 1.0f)
+ {
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[2].Value = "Ground Force Training Facilities";
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[3].Value = Math.Floor(CurrentPopulation.Installations[(int)Installation.InstallationType.GroundForceTrainingFacility].Number).ToString();
+
+ Adjust2++;
+ }
+
+ ///
+ /// Don't want to print this space if there is nothing above it.
+ ///
+ if (Adjust2 != 0 && (string)m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[3].Value != "")
+ {
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[2].Value = "";
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[3].Value = "";
+
+ Adjust2++;
+ }
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[2].Value = "Fuel Available";
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2++].Cells[3].Value = CurrentPopulation.FuelStockpile.ToString();
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[2].Value = "Maintenance Supplies Available";
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2++].Cells[3].Value = CurrentPopulation.MaintenanceSupplies.ToString();
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[2].Value = "";
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2++].Cells[3].Value = "";
+
+
+
+#warning Calcluate these signatures in simEntity
+ CurrentPopulation.CalcThermalSignature();
+ CurrentPopulation.CalcEMSignature();
+
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[2].Value = "Thermal Signature of Colony";
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2++].Cells[3].Value = CurrentPopulation.ThermalSignature.ToString();
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[2].Value = "EM Signature of Colony";
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2++].Cells[3].Value = CurrentPopulation.EMSignature.ToString();
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[2].Value = "";
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2++].Cells[3].Value = "";
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[2].Value = "Economic Production Modifier";
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2++].Cells[3].Value = (CurrentPopulation.ModifierEconomicProduction * 100).ToString() + "%";
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[2].Value = "Manufacturing Efficiency Modifier";
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2++].Cells[3].Value = (CurrentPopulation.ModifierManfacturing * 100).ToString() + "%";
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[2].Value = "Political Status Production Modifier";
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2++].Cells[3].Value = (CurrentPopulation.ModifierProduction * 100).ToString() + "%";
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[2].Value ="Political Status Wealth/Trade Modifier";
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2++].Cells[3].Value = (CurrentPopulation.ModifierWealthAndTrade * 100).ToString() + "%";
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2].Cells[2].Value = "Political Status Modifier";
+ m_oSummaryPanel.SummaryDataGrid.Rows[Adjust2++].Cells[3].Value = (CurrentPopulation.ModifierPoliticalStability * 100).ToString() + "%";
+
+ for (int rowIterator = Adjust2; rowIterator < 38; rowIterator++)
+ {
+ m_oSummaryPanel.SummaryDataGrid.Rows[rowIterator].Cells[2].Value = "";
+ m_oSummaryPanel.SummaryDataGrid.Rows[rowIterator].Cells[3].Value = "";
+ }
+ }
}
catch
{
@@ -742,6 +1458,7 @@ public void RefreshSummaryCells()
#endif
}
}
+ #endregion
#endregion
diff --git a/Pulsar4X/Pulsar4X.UI/Handlers/Ships.cs b/Pulsar4X/Pulsar4X.UI/Handlers/Ships.cs
index d5b1bd85c..9dba939c3 100644
--- a/Pulsar4X/Pulsar4X.UI/Handlers/Ships.cs
+++ b/Pulsar4X/Pulsar4X.UI/Handlers/Ships.cs
@@ -511,7 +511,8 @@ private void SetPDModeButton_Click(object sender, EventArgs e)
///
if (_CurrnetFaction.PointDefense.ContainsKey(CurrentSystem) == false)
{
- String Error = String.Format("Star System {0} not found in point defense listing for {1} on {2}.", CurrentSystem, _CurrnetShip.ShipMFC[_CurrnetFC.componentIndex], _CurrnetShip);
+#warning leave this error message in for now
+ String Error = String.Format("Star System {0} not found in point defense listing for {1} on {2}. Not necessarily a bug.", CurrentSystem, _CurrnetShip.ShipMFC[_CurrnetFC.componentIndex], _CurrnetShip);
MessageEntry MessageEnter = new MessageEntry(MessageEntry.MessageType.Error, _CurrnetShip.ShipsTaskGroup.Contact.CurrentSystem, _CurrnetShip.ShipsTaskGroup.Contact,
GameState.Instance.GameDateTime, (GameState.SE.CurrentTick - GameState.SE.lastTick), Error);
_CurrnetFaction.MessageLog.Add(MessageEnter);
diff --git a/Pulsar4X/Pulsar4X.UI/Panels/Eco_Summary.cs b/Pulsar4X/Pulsar4X.UI/Panels/Eco_Summary.cs
index 06ec31259..7fc616c10 100644
--- a/Pulsar4X/Pulsar4X.UI/Panels/Eco_Summary.cs
+++ b/Pulsar4X/Pulsar4X.UI/Panels/Eco_Summary.cs
@@ -41,10 +41,10 @@ public Eco_Summary()
m_oSummaryDataGrid.AllowUserToAddRows = false;
m_oSummaryDataGrid.AllowUserToDeleteRows = false;
m_oSummaryDataGrid.AllowUserToOrderColumns = false;
- m_oSummaryDataGrid.AllowUserToResizeColumns = true;
- m_oSummaryDataGrid.AllowUserToResizeRows = true;
+ m_oSummaryDataGrid.AllowUserToResizeColumns = false;
+ m_oSummaryDataGrid.AllowUserToResizeRows = false;
m_oSummaryDataGrid.ReadOnly = true;
- m_oSummaryDataGrid.Enabled = false;
+ m_oSummaryDataGrid.Enabled = true;
m_oSummaryGroupBox.Controls.Add(m_oSummaryDataGrid);
}
}
diff --git a/Pulsar4X/Pulsar4X.UI/Program.cs b/Pulsar4X/Pulsar4X.UI/Program.cs
index 4818b6cde..c144a752b 100644
--- a/Pulsar4X/Pulsar4X.UI/Program.cs
+++ b/Pulsar4X/Pulsar4X.UI/Program.cs
@@ -50,7 +50,6 @@ static void Main()
/// This following section should probably be moved to the Faction constructor at some point.
///
oNewFaction.Populations.Add(new Entities.Population(otest.Stars.FirstOrDefault().Planets.FirstOrDefault(), oNewFaction));
- oNewFaction.Populations.First().CivilianPopulation = 100.0f;
GameState.Instance.Factions.Add(oNewFaction);
oNewFaction.AddNewContactList(otest);
@@ -120,6 +119,7 @@ static void Main()
oNewFaction.ShipDesigns[1].SetPreferredOrdnance(CL.MissileDef[1], 200);
oNewFaction.ShipDesigns[1].IsLocked = true;
oNewFaction.ShipDesigns[1].BuildClassSummary();
+
oNewFaction.TaskGroups[0].AddShip(oNewFaction.ShipDesigns[0], 0);
oNewFaction.TaskGroups[0].AddShip(oNewFaction.ShipDesigns[0], 0);