示例#1
0
 public static bool TryParseType(string str, out StellarType value)
 {
     return(Enum.TryParse <StellarType>(str, out value));
 }
 public override object ConvertFromString(string text, IReaderRow row, MemberMapData memberMapData)
 {
     return(StellarType.FromString(text));
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="StellarBody"/> class.
 /// </summary>
 /// <param name="st">The StellarType of the Body to construct.</param>
 /// <param name="name">The name.</param>
 public StellarBody(StellarType st, string name) : this(Provider.Use().GetService <IScienceAstrophysics>(), st, name)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="StellarBody"/> class.
 /// </summary>
 /// <param name="phy">The Science interface to use.</param>
 /// <param name="st">The StellarType of the Body to construct.</param>
 /// <param name="name">The name.</param>
 public StellarBody(IScienceAstrophysics phy, StellarType st, string name) : this(phy, st)
 {
     Name = name;
 }
示例#5
0
 private static Vector4 CalcColor(
     StellarType type,
     KeyValuePair <StellarType, Vector4>[] colorTable)
 {
     return(((IEnumerable <KeyValuePair <StellarType, Vector4> >)colorTable).First <KeyValuePair <StellarType, Vector4> >((Func <KeyValuePair <StellarType, Vector4>, bool>)(x => x.Key == type)).Value);
 }