Skip to content

Commit

Permalink
Fix unknown economy definition HighTech.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tkael committed Nov 9, 2019
1 parent 59f6cee commit 037503c
Showing 1 changed file with 23 additions and 16 deletions.
39 changes: 23 additions & 16 deletions DataDefinitions/Economy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@ static Economy()
resourceManager.IgnoreCase = false;
missingEDNameHandler = (edname) => new Economy(edname);

None = new Economy("$economy_None");
var Agriculture = new Economy("$economy_Agri");
var Colony = new Economy("$economy_Colony");
var Damaged = new Economy("$economy_Damaged");
var Extraction = new Economy("$economy_Extraction");
var Refinery = new Economy("$economy_Refinery");
var Repair = new Economy("$economy_Repair");
var Rescue = new Economy("$economy_Rescue");
var Industrial = new Economy("$economy_Industrial");
var Terraforming = new Economy("$economy_Terraforming");
var HighTech = new Economy("$economy_HighTech");
var Service = new Economy("$economy_Service");
var Tourism = new Economy("$economy_Tourism");
var Military = new Economy("$economy_Military");
var Prison = new Economy("$economy_Prison");
None = new Economy("None");
var Agriculture = new Economy("Agri");
var Colony = new Economy("Colony");
var Damaged = new Economy("Damaged");
var Extraction = new Economy("Extraction");
var Refinery = new Economy("Refinery");
var Repair = new Economy("Repair");
var Rescue = new Economy("Rescue");
var Industrial = new Economy("Industrial");
var Terraforming = new Economy("Terraforming");
var HighTech = new Economy("HighTech");
var Service = new Economy("Service");
var Tourism = new Economy("Tourism");
var Military = new Economy("Military");
var Prison = new Economy("Prison");
}

public static readonly Economy None;
Expand All @@ -35,7 +35,14 @@ static Economy()
public Economy() : this("")
{ }

private Economy(string edname) : base(edname, edname.Replace("$economy_", "").Replace(";", ""))
private Economy(string edname) : base(edname, edname)
{ }

public new static Economy FromEDName(string edname)
{
// Economy names from the journal are prefixed with "$economy_" and sufficed with ";" while economy names from the Frontier API are not.
string tidiedName = edname.Replace("$economy_", "").Replace(";", "");
return ResourceBasedLocalizedEDName<Economy>.FromEDName(tidiedName);
}
}
}

0 comments on commit 037503c

Please sign in to comment.