Skip to content

Commit

Permalink
Changed planetparent name property to simply parentname since it woul…
Browse files Browse the repository at this point in the history
…d work better with the system hierarchy
  • Loading branch information
8vogt committed Mar 22, 2021
1 parent e64cd5a commit aea5d7e
Showing 1 changed file with 23 additions and 15 deletions.
38 changes: 23 additions & 15 deletions SEWorldGenPlugin/Generator/MyStarSystemGenerator.Naming.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
using SEWorldGenPlugin.ObjectBuilders;
using SEWorldGenPlugin.Utilities;
using SEWorldGenPlugin.Utilities;

namespace SEWorldGenPlugin.Generator
{
public partial class MyStarSystemGenerator
{
public static readonly string PROP_OBJ_NUMBER = "ObjectNumber";
public static readonly string PROP_OBJ_NUMBER_GREEK = "ObjectNumberGreek";
public static readonly string PROP_OBJ_NUMBER_ROMAN = "ObjectNumberRoman";
public static readonly string PROP_OBJ_LETTER_LOWER = "ObjectLetterLower";
public static readonly string PROP_OBJ_LETTER_UPPER = "ObjectLetterUpper";
public static readonly string PROP_OBJ_ID = "ObjectId";
public static readonly string PROP_OBJ_PARENT = "ParentName";


/// <summary>
/// Generates a name for the planet based on the naming scheme
/// defined in the global settings file
Expand All @@ -16,12 +24,12 @@ private string GetPlanetName(int planetIndex, string subtypeId)
{
string namingScheme = MySettings.Static.Settings.PlanetNameFormat;

string name = namingScheme.SetProperty("ObjectNumber", planetIndex + 1)
.SetProperty("ObjectNumberGreek", MyNamingUtils.GREEK_LETTERS[planetIndex % MyNamingUtils.GREEK_LETTERS.Length])
.SetProperty("ObjectNumberRoman", MyNamingUtils.ConvertNumberToRoman(planetIndex + 1))
.SetProperty("ObjectLetterLower", (char)('a' + (planetIndex % 26)))
.SetProperty("ObjectLetterUpper", (char)('A' + (planetIndex % 26)))
.SetProperty("ObjectId", subtypeId);
string name = namingScheme.SetProperty(PROP_OBJ_NUMBER, planetIndex + 1)
.SetProperty(PROP_OBJ_NUMBER_GREEK, MyNamingUtils.GREEK_LETTERS[planetIndex % MyNamingUtils.GREEK_LETTERS.Length])
.SetProperty(PROP_OBJ_NUMBER_ROMAN, MyNamingUtils.ConvertNumberToRoman(planetIndex + 1))
.SetProperty(PROP_OBJ_LETTER_LOWER, (char)('a' + (planetIndex % 26)))
.SetProperty(PROP_OBJ_LETTER_UPPER, (char)('A' + (planetIndex % 26)))
.SetProperty(PROP_OBJ_ID, subtypeId);

return name;
}
Expand All @@ -38,13 +46,13 @@ private string GetMoonName(int moonIndex, string subtypeId, string parentPlanetN
{
string namingScheme = MySettings.Static.Settings.MoonNameFormat;

string name = namingScheme.SetProperty("ObjectNumber", moonIndex + 1)
.SetProperty("ObjectNumberGreek", MyNamingUtils.GREEK_LETTERS[moonIndex % MyNamingUtils.GREEK_LETTERS.Length])
.SetProperty("ObjectNumberRoman", MyNamingUtils.ConvertNumberToRoman(moonIndex + 1))
.SetProperty("ObjectLetterLower", (char)('a' + (moonIndex % 26)))
.SetProperty("ObjectLetterUpper", (char)('A' + (moonIndex % 26)))
.SetProperty("ObjectId", subtypeId)
.SetProperty("MoonPlanetName", parentPlanetName);
string name = namingScheme.SetProperty(PROP_OBJ_NUMBER, moonIndex + 1)
.SetProperty(PROP_OBJ_NUMBER_GREEK, MyNamingUtils.GREEK_LETTERS[moonIndex % MyNamingUtils.GREEK_LETTERS.Length])
.SetProperty(PROP_OBJ_NUMBER_ROMAN, MyNamingUtils.ConvertNumberToRoman(moonIndex + 1))
.SetProperty(PROP_OBJ_LETTER_LOWER, (char)('a' + (moonIndex % 26)))
.SetProperty(PROP_OBJ_LETTER_UPPER, (char)('A' + (moonIndex % 26)))
.SetProperty(PROP_OBJ_ID, subtypeId)
.SetProperty(PROP_OBJ_PARENT, parentPlanetName);

return name;
}
Expand Down

0 comments on commit aea5d7e

Please sign in to comment.