-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor to remove unnecessary ship `EliteID` property. Prefer to use ship model in all cases. Refactor ShipManufacturer into its own class.
- Loading branch information
Showing
8 changed files
with
134 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using Utilities; | ||
|
||
namespace EddiDataDefinitions | ||
{ | ||
public class ShipManufacturer | ||
{ | ||
public static readonly ShipManufacturer CoreDynamics = new ShipManufacturer ( "Core Dynamics" ); | ||
public static readonly ShipManufacturer FaulconDeLacy = new ShipManufacturer ( "Faulcon DeLacy" ); | ||
public static readonly ShipManufacturer Gutamaya = new ShipManufacturer ( "Gutamaya", new List<Translation> {new Translation("Gutamaya", "guːtəˈmaɪə") } ); | ||
public static readonly ShipManufacturer LakonSpaceways = new ShipManufacturer ( "Lakon Spaceways", new List<Translation> {new Translation("Lakon", "leɪkɒn"), new Translation("Spaceways", "speɪsweɪz") } ); | ||
public static readonly ShipManufacturer SaudKruger = new ShipManufacturer ( "Saud Kruger", new List<Translation> {new Translation("Saud", "saʊd"), new Translation("Kruger", "ˈkruːɡə") } ); | ||
public static readonly ShipManufacturer ZorgonPeterson = new ShipManufacturer ( "Zorgon Peterson" ); | ||
|
||
public static readonly List<ShipManufacturer> AllOfThem = new List<ShipManufacturer>() | ||
{ | ||
CoreDynamics, | ||
FaulconDeLacy, | ||
Gutamaya, | ||
LakonSpaceways, | ||
SaudKruger, | ||
ZorgonPeterson | ||
}; | ||
|
||
public string name { get; } | ||
|
||
public List<Translation> phoneticName { get; } | ||
|
||
private ShipManufacturer ( string name, List<Translation> phoneticName = null ) | ||
{ | ||
this.name = name; | ||
this.phoneticName = phoneticName; | ||
} | ||
|
||
public static string SpokenManufacturer(string manufacturer) | ||
{ | ||
var phoneticmanufacturer = AllOfThem.FirstOrDefault(m => m.name == manufacturer)?.phoneticName; | ||
if (phoneticmanufacturer != null) | ||
{ | ||
var result = ""; | ||
foreach (var item in phoneticmanufacturer) | ||
{ | ||
result += "<phoneme alphabet=\"ipa\" ph=\"" + item.to + "\">" + item.from + "</phoneme> "; | ||
} | ||
return result; | ||
} | ||
// Model isn't in the dictionary | ||
return null; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters