Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
Removed remaining patent and research references.
Fixed issue with ship fuel number format culture.
Changed ship fuel column to a percentage.
  • Loading branch information
Deantwo committed Feb 27, 2024
1 parent ddd2205 commit 19646c4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 49 deletions.
44 changes: 1 addition & 43 deletions HCity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,24 +135,6 @@ public int PowerReserveCapacity
get { return _factilitiesJobs; }
}

protected Dictionary<string, int> _researchProjects = new Dictionary<string, int>();
public Dictionary<string, int> ReseatchProjects
{
get { return _researchProjects; }
}

protected new Dictionary<string, int> _patents = new Dictionary<string, int>();
public new Dictionary<string, int> Patents
{
get { return _patents; }
}

protected string _patentsOverview = "";
public string PatentsOverview
{
get { return _patentsOverview; }
}

protected int _population = 0;
public int Population
{
Expand Down Expand Up @@ -249,12 +231,6 @@ public long BankIncomeProduct
get { return _bankIncomeProduct; }
}

protected long _bankIncomeResearch = 0;
public long BankIncomeResearch
{
get { return _bankIncomeResearch; }
}

protected long _bankExpensePayroll = 0;
public long BankExpensePayroll
{
Expand Down Expand Up @@ -285,11 +261,6 @@ public long BankExpenseWithdrawals
get { return _bankExpenseWithdrawals; }
}

protected long _bankExpenseResearch = 0;
public long BankExpenseResearch
{
get { return _bankExpenseResearch; }
}

protected long _bankTribute = 0;
public long BankTribute
Expand Down Expand Up @@ -614,12 +585,6 @@ public override void Initialize()
line = tempArray[i].Replace(System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberGroupSeparator, "");
_bankIncomeProduct = Convert.ToInt64(line.Remove(line.Length - 1));
}
else if (line == "Research and Development Canceled")
{
i++;
line = tempArray[i].Replace(System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberGroupSeparator, "");
_bankIncomeResearch = Convert.ToInt64(line.Remove(line.Length - 1));
}
else if (line == "Product Purchases")
{
i++;
Expand All @@ -638,12 +603,6 @@ public override void Initialize()
line = tempArray[i].Replace(System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberGroupSeparator, "");
_bankExpenseWithdrawals = Convert.ToInt64(line.Remove(line.Length - 1));
}
else if (line == "Research and Development")
{
i++;
line = tempArray[i].Replace(System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberGroupSeparator, "");
_bankExpenseResearch = Convert.ToInt64(line.Remove(line.Length - 1));
}
else if (line == "Rewards")
{
i++;
Expand Down Expand Up @@ -737,7 +696,7 @@ public override void Initialize()
tempArray = reportSection.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);

int startpos, length;
if (reportSection.Contains("Air:"))
if (reportSection.Contains("Air: "))
{
_hashEnv = true;

Expand Down Expand Up @@ -1007,7 +966,6 @@ protected void UpdateBankOverview()
sb.AppendLine($" {_bankIncomeMinting.ToString("C", Hazeron.NumberFormat).PadLeft(Hazeron.CurrencyPadding)} bullion minting");
sb.AppendLine();
sb.AppendLine($" {(-_bankExpenseWithdrawals).ToString("C", Hazeron.NumberFormat).PadLeft(Hazeron.CurrencyPadding)} withdrawals");
sb.AppendLine($" {(-_bankExpenseResearch).ToString("C", Hazeron.NumberFormat).PadLeft(Hazeron.CurrencyPadding)} research expense");
sb.AppendLine();
sb.AppendLine($" {(_bankBalance - _bankBalanceOld).ToString("C", Hazeron.NumberFormat).PadLeft(Hazeron.CurrencyPadding)} government account net-change");
sb.AppendLine($" {_bankBalance.ToString("C", Hazeron.NumberFormat).PadLeft(Hazeron.CurrencyPadding)} government account balance");
Expand Down
9 changes: 5 additions & 4 deletions HShip.cs
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ public override void Initialize()
reportSection = HHelper.CleanText(reportSection);
_accountOverview = reportSection;
tempArray = reportSection.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
_accountColumn = tempArray[1].Remove(tempArray[1].IndexOf('¢') + 1).Replace(',', '\'').Replace('.', '\'');
_accountBalance = Convert.ToInt64(_accountColumn.Remove(_accountColumn.IndexOf('¢')).Replace("'", ""));
_accountColumn = tempArray[1].Remove(tempArray[1].IndexOf('¢') + 1).Replace(System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberGroupSeparator, "");
_accountBalance = Convert.ToInt64(_accountColumn.Remove(_accountColumn.IndexOf('¢')).Replace(System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberGroupSeparator, ""));
_accountColumn = _accountBalance.ToString("C", Hazeron.NumberFormat);
}

Expand All @@ -237,9 +237,10 @@ public override void Initialize()
reportSection = reportSection.Substring(16);
_fuelColumn = reportSection.Remove(reportSection.IndexOf(Environment.NewLine) - 11);
tempArray = _fuelColumn.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
_fuel = Convert.ToInt32(tempArray[0]);
_fuelCapacity = Convert.ToInt32(tempArray[tempArray.Length - 1]);
_fuel = Convert.ToInt32(tempArray[0].Replace(System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberGroupSeparator, ""));
_fuelCapacity = Convert.ToInt32(tempArray[tempArray.Length - 1].Replace(System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberGroupSeparator, ""));
_fuelQuality = Convert.ToInt32(tempArray[1].Substring(1));
_fuelColumn = $"{(float)_fuel / _fuelCapacity * 100}% Q{_fuelQuality}";
}

// CARGO
Expand Down
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.0")]
[assembly: AssemblyVersion("2.0.1.0")]
[assembly: AssemblyFileVersion("2.0.1.0")]

0 comments on commit 19646c4

Please sign in to comment.