2024-07-19 17:08:37 +00:00
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
2024-07-19 20:00:13 +00:00
|
|
|
|
using System.Globalization;
|
2024-07-19 17:08:37 +00:00
|
|
|
|
using CSV = CsvHelper.Configuration.Attributes;
|
|
|
|
|
|
2024-07-23 18:20:01 +00:00
|
|
|
|
namespace net.nehmer.sa.Model;
|
2024-07-19 17:08:37 +00:00
|
|
|
|
|
|
|
|
|
public class Planet
|
|
|
|
|
{
|
2024-07-19 20:00:13 +00:00
|
|
|
|
[Key, CSV.Index(0)]
|
2024-07-19 17:08:37 +00:00
|
|
|
|
public required string Name { get; set; }
|
|
|
|
|
|
2024-07-19 20:00:13 +00:00
|
|
|
|
[CSV.Index(1)]
|
2024-07-19 17:08:37 +00:00
|
|
|
|
public string? Owner { get; set; }
|
2024-07-19 20:00:13 +00:00
|
|
|
|
|
|
|
|
|
[CSV.Index(2)]
|
2024-07-19 17:08:37 +00:00
|
|
|
|
public string? StarbaseType { get; set; }
|
2024-07-19 20:00:13 +00:00
|
|
|
|
|
|
|
|
|
[CSV.Index(3)]
|
2024-07-19 17:08:37 +00:00
|
|
|
|
public int ReportAge { get; set; } = 0;
|
2024-07-19 20:00:13 +00:00
|
|
|
|
|
|
|
|
|
[CSV.Index(4)]
|
2024-07-19 17:08:37 +00:00
|
|
|
|
public int? Population { get; set; }
|
2024-07-19 20:00:13 +00:00
|
|
|
|
|
|
|
|
|
[CSV.Ignore()]
|
2024-07-19 17:08:37 +00:00
|
|
|
|
public int? Value { get; set; }
|
2024-07-19 20:00:13 +00:00
|
|
|
|
|
|
|
|
|
[CSV.Index(5)]
|
|
|
|
|
public string CSVValue {
|
|
|
|
|
set {
|
|
|
|
|
if ( value.Length >= 2
|
|
|
|
|
&& int.TryParse(value[..^1], out int result))
|
|
|
|
|
{
|
|
|
|
|
Value = result;
|
|
|
|
|
} else {
|
|
|
|
|
Value = null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[CSV.Index(7)]
|
2024-07-19 17:08:37 +00:00
|
|
|
|
public int? Mines { get; set; }
|
2024-07-19 20:00:13 +00:00
|
|
|
|
|
|
|
|
|
[CSV.Index(8)]
|
2024-07-19 17:08:37 +00:00
|
|
|
|
public int? Factories { get; set; }
|
2024-07-19 20:00:13 +00:00
|
|
|
|
|
|
|
|
|
[CSV.Ignore()]
|
2024-07-19 17:08:37 +00:00
|
|
|
|
public decimal? DefPercent { get; set; }
|
2024-07-19 20:00:13 +00:00
|
|
|
|
|
|
|
|
|
[CSV.Index(9)]
|
|
|
|
|
public string CSVDefPercent {
|
|
|
|
|
set {
|
|
|
|
|
if ( value.Length >= 2
|
|
|
|
|
&& Decimal.TryParse(value[..^1], NumberStyles.Float, CultureInfo.InvariantCulture, out decimal result))
|
|
|
|
|
{
|
|
|
|
|
DefPercent = result;
|
|
|
|
|
} else {
|
|
|
|
|
DefPercent = null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[CSV.Index(10)]
|
2024-07-19 17:08:37 +00:00
|
|
|
|
public int? SurfaceIronium { get; set; }
|
2024-07-19 20:00:13 +00:00
|
|
|
|
|
|
|
|
|
[CSV.Index(11)]
|
2024-07-19 17:08:37 +00:00
|
|
|
|
public int? SurfaceBoranium { get; set; }
|
2024-07-19 20:00:13 +00:00
|
|
|
|
|
|
|
|
|
[CSV.Index(12)]
|
2024-07-19 17:08:37 +00:00
|
|
|
|
public int? SurfaceGermanium { get; set; }
|
2024-07-19 20:00:13 +00:00
|
|
|
|
|
|
|
|
|
[CSV.Index(13)]
|
2024-07-19 17:08:37 +00:00
|
|
|
|
public int? MRIronium { get; set; }
|
2024-07-19 20:00:13 +00:00
|
|
|
|
|
|
|
|
|
[CSV.Index(14)]
|
2024-07-19 17:08:37 +00:00
|
|
|
|
public int? MRBoranium { get; set; }
|
2024-07-19 20:00:13 +00:00
|
|
|
|
|
|
|
|
|
[CSV.Index(15)]
|
2024-07-19 17:08:37 +00:00
|
|
|
|
public int? MRGermanium { get; set; }
|
2024-07-19 20:00:13 +00:00
|
|
|
|
|
|
|
|
|
[CSV.Index(16)]
|
2024-07-19 17:08:37 +00:00
|
|
|
|
public int? MCIronium { get; set; }
|
2024-07-19 20:00:13 +00:00
|
|
|
|
|
|
|
|
|
[CSV.Index(17)]
|
2024-07-19 17:08:37 +00:00
|
|
|
|
public int? MCBoranium { get; set; }
|
2024-07-19 20:00:13 +00:00
|
|
|
|
|
|
|
|
|
[CSV.Index(18)]
|
|
|
|
|
public int? MCGrmanium { get; set; }
|
|
|
|
|
|
|
|
|
|
[CSV.Index(19)]
|
2024-07-19 17:08:37 +00:00
|
|
|
|
public int? Resources { get; set; }
|
2024-07-19 20:00:13 +00:00
|
|
|
|
|
|
|
|
|
[CSV.Ignore()]
|
2024-07-19 17:08:37 +00:00
|
|
|
|
public decimal? Gravity { get; set; }
|
2024-07-19 20:00:13 +00:00
|
|
|
|
|
|
|
|
|
[CSV.Index(20)]
|
|
|
|
|
public string CSVGravity {
|
|
|
|
|
set {
|
|
|
|
|
if ( value.Length >= 2
|
|
|
|
|
&& Decimal.TryParse(value[..^1], NumberStyles.Float, CultureInfo.InvariantCulture, out decimal result))
|
|
|
|
|
{
|
|
|
|
|
Gravity = result;
|
|
|
|
|
} else {
|
|
|
|
|
Gravity = null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[CSV.Ignore()]
|
2024-07-19 17:08:37 +00:00
|
|
|
|
public decimal? Temperature { get; set; }
|
2024-07-19 20:00:13 +00:00
|
|
|
|
|
|
|
|
|
[CSV.Index(21)]
|
|
|
|
|
public string CSVTemperature {
|
|
|
|
|
set {
|
|
|
|
|
if ( value.Length >= 3
|
|
|
|
|
&& Decimal.TryParse(value[..^2], NumberStyles.Float, CultureInfo.InvariantCulture, out decimal result))
|
|
|
|
|
{
|
|
|
|
|
Temperature = result;
|
|
|
|
|
} else {
|
|
|
|
|
Temperature = null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[CSV.Ignore()]
|
2024-07-19 17:08:37 +00:00
|
|
|
|
public decimal? Radiation { get; set; }
|
2024-07-19 20:00:13 +00:00
|
|
|
|
|
|
|
|
|
[CSV.Index(22)]
|
|
|
|
|
public string CSVRadiation {
|
|
|
|
|
set {
|
|
|
|
|
if ( value.Length >= 3
|
|
|
|
|
&& Decimal.TryParse(value[..^2], NumberStyles.Float, CultureInfo.InvariantCulture, out decimal result))
|
|
|
|
|
{
|
|
|
|
|
Radiation = result;
|
|
|
|
|
} else {
|
|
|
|
|
Radiation = null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[CSV.Ignore()]
|
2024-07-19 17:08:37 +00:00
|
|
|
|
public decimal? GravityOrig { get; set; }
|
2024-07-19 20:00:13 +00:00
|
|
|
|
|
|
|
|
|
[CSV.Index(20)]
|
|
|
|
|
public string CSVGravityOrig {
|
|
|
|
|
set {
|
|
|
|
|
if ( value.Length >= 2
|
|
|
|
|
&& Decimal.TryParse(value[..^1], NumberStyles.Float, CultureInfo.InvariantCulture, out decimal result))
|
|
|
|
|
{
|
|
|
|
|
GravityOrig = result;
|
|
|
|
|
} else {
|
|
|
|
|
GravityOrig = null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
[CSV.Ignore()]
|
2024-07-19 17:08:37 +00:00
|
|
|
|
public decimal? TemperatureOrig { get; set; }
|
2024-07-19 20:00:13 +00:00
|
|
|
|
|
|
|
|
|
[CSV.Index(24)]
|
|
|
|
|
public string CSVTemperatureOrig {
|
|
|
|
|
set {
|
|
|
|
|
if ( value.Length >= 3
|
|
|
|
|
&& Decimal.TryParse(value[..^2], NumberStyles.Float, CultureInfo.InvariantCulture, out decimal result))
|
|
|
|
|
{
|
|
|
|
|
TemperatureOrig = result;
|
|
|
|
|
} else {
|
|
|
|
|
TemperatureOrig = null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[CSV.Ignore()]
|
2024-07-19 17:08:37 +00:00
|
|
|
|
public decimal? RadiationOrig { get; set; }
|
2024-07-19 20:00:13 +00:00
|
|
|
|
|
|
|
|
|
[CSV.Index(25)]
|
|
|
|
|
public string CSVRadiationOrig {
|
|
|
|
|
set {
|
|
|
|
|
if ( value.Length >= 3
|
|
|
|
|
&& Decimal.TryParse(value[..^2], NumberStyles.Float, CultureInfo.InvariantCulture, out decimal result))
|
|
|
|
|
{
|
|
|
|
|
RadiationOrig = result;
|
|
|
|
|
} else {
|
|
|
|
|
RadiationOrig = null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[CSV.Ignore()]
|
2024-07-19 17:08:37 +00:00
|
|
|
|
public int? MaxTerraforming { get; set; }
|
2024-07-19 20:00:13 +00:00
|
|
|
|
|
|
|
|
|
[CSV.Index(26)]
|
|
|
|
|
public string CSVMaxTerraforming {
|
|
|
|
|
set {
|
|
|
|
|
if ( value.Length >= 2
|
|
|
|
|
&& int.TryParse(value[..^1], out int result))
|
|
|
|
|
{
|
|
|
|
|
MaxTerraforming = result;
|
|
|
|
|
} else {
|
|
|
|
|
MaxTerraforming = null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[CSV.Index(27)]
|
2024-07-19 17:08:37 +00:00
|
|
|
|
public int? CapacityPercent { get; set; }
|
2024-07-19 20:00:13 +00:00
|
|
|
|
|
|
|
|
|
[CSV.Index(28)]
|
2024-07-19 17:08:37 +00:00
|
|
|
|
public int? ScanRange { get; set; }
|
2024-07-19 20:00:13 +00:00
|
|
|
|
|
|
|
|
|
[CSV.Index(29)]
|
2024-07-19 17:08:37 +00:00
|
|
|
|
public int? PenScanRange { get; set; }
|
2024-07-19 20:00:13 +00:00
|
|
|
|
|
|
|
|
|
[CSV.Index(30)]
|
2024-07-19 17:08:37 +00:00
|
|
|
|
public int? Driver { get; set; }
|
2024-07-19 20:00:13 +00:00
|
|
|
|
|
|
|
|
|
[CSV.Index(31)]
|
2024-07-19 17:08:37 +00:00
|
|
|
|
public int? DriverWarp { get; set; }
|
2024-07-19 20:00:13 +00:00
|
|
|
|
|
|
|
|
|
[CSV.Index(32)]
|
2024-07-19 17:08:37 +00:00
|
|
|
|
public string? RouteTarget { get; set; }
|
2024-07-19 20:00:13 +00:00
|
|
|
|
|
|
|
|
|
[CSV.Index(33)]
|
2024-07-19 17:08:37 +00:00
|
|
|
|
public int? GateRange { get; set; }
|
2024-07-19 20:00:13 +00:00
|
|
|
|
|
|
|
|
|
[CSV.Index(34)]
|
2024-07-19 17:08:37 +00:00
|
|
|
|
public int? GateMass { get; set; }
|
2024-07-19 20:00:13 +00:00
|
|
|
|
|
|
|
|
|
[CSV.Index(35)]
|
2024-07-19 17:08:37 +00:00
|
|
|
|
public int? PctDamage { get; set; }
|
|
|
|
|
}
|