Skip to content

Commit

Permalink
add TextKind type to better specify how a type should be treated
Browse files Browse the repository at this point in the history
  • Loading branch information
floribe2000 committed Oct 9, 2023
1 parent 0f88b50 commit 37a4df0
Show file tree
Hide file tree
Showing 36 changed files with 245 additions and 233 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public partial record AirstrikeDataContainer : DataContainerBase
{
public string Header { get; set; } = default!;

[DataElementType(DataElementTypes.KeyValue, IsValueLocalizationKey = true)]
[DataElementType(DataElementTypes.KeyValue, ValueTextKind = TextKind.LocalizationKey)]
public string Name { get; set; } = default!;

[DataElementType(DataElementTypes.KeyValueUnit, UnitKey = "HP")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace WoWsShipBuilder.DataContainers;
[DataContainer]
public partial record MainBatteryDataContainer : DataContainerBase
{
[DataElementType(DataElementTypes.FormattedText, ValuesPropertyName = "TurretNames", ArePropertyNameValuesKeys = true)]
[DataElementType(DataElementTypes.FormattedText, ArgumentsCollectionName = "TurretNames", ArgumentsTextKind = TextKind.LocalizationKey)]
public string Name { get; set; } = default!;

public List<string> TurretNames { get; set; } = new();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ public partial record PingerGunDataContainer : DataContainerBase
[DataElementType(DataElementTypes.KeyValueUnit, UnitKey = "KM")]
public decimal Range { get; set; }

[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "PingDuration", UnitKey = "S", NameLocalizationKey = "First")]
[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "PingDuration", UnitKey = "S", LocalizationKeyOverride = "First")]
public decimal FirstPingDuration { get; set; }

[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "PingDuration", UnitKey = "S", NameLocalizationKey = "Second")]
[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "PingDuration", UnitKey = "S", LocalizationKeyOverride = "Second")]
public decimal SecondPingDuration { get; set; }

[DataElementType(DataElementTypes.KeyValueUnit, UnitKey = "M")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public partial record SecondaryBatteryDataContainer : DataContainerBase
{
Name = arrangementString,
TurretName = turretName,
TurretSetup = new(arrangementString, turretName, AreValuesKeys: true),
TurretSetup = new(arrangementString, turretName, ArgumentsTextKind: DataElementTextKind.LocalizationKey),
BarrelsLayout = $"{secondaryGroup.Count} x {secondaryGun.NumBarrels}",
BarrelsCount = secondaryGroup.Count * secondaryGun.NumBarrels,
GunCaliber = Math.Round(secondaryGun.BarrelDiameter * 1000),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace WoWsShipBuilder.DataContainers;
[DataContainer]
public partial record TorpedoArmamentDataContainer : DataContainerBase
{
[DataElementType(DataElementTypes.FormattedText, ValuesPropertyName = "LauncherNames", ArePropertyNameValuesKeys = true)]
[DataElementType(DataElementTypes.FormattedText, ArgumentsCollectionName = "LauncherNames", ArgumentsTextKind = TextKind.LocalizationKey)]
public string Name { get; set; } = default!;

public List<string> LauncherNames { get; set; } = new();
Expand Down Expand Up @@ -40,10 +40,10 @@ public partial record TorpedoArmamentDataContainer : DataContainerBase
[DataElementType(DataElementTypes.KeyValue)]
public string FullSalvoDamage { get; set; } = default!;

[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValue, GroupKey = "FullSalvoDamage", NameLocalizationKey = "FirstOption")]
[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValue, GroupKey = "FullSalvoDamage", LocalizationKeyOverride = "FirstOption")]
public string TorpFullSalvoDmg { get; set; } = default!;

[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValue, GroupKey = "FullSalvoDamage", NameLocalizationKey = "SecondOption")]
[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValue, GroupKey = "FullSalvoDamage", LocalizationKeyOverride = "SecondOption")]
public string AltTorpFullSalvoDmg { get; set; } = default!;

public int LoadersCount { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ namespace WoWsShipBuilder.DataContainers;
[DataContainer]
public partial record BombDataContainer : ProjectileDataContainer
{
[DataElementType(DataElementTypes.KeyValue, IsValueLocalizationKey = true, IsValueAppLocalization = true)]
[DataElementType(DataElementTypes.KeyValue, ValueTextKind = TextKind.AppLocalizationKey)]
public string BombType { get; set; } = default!;

[DataElementType(DataElementTypes.KeyValue, IsValueLocalizationKey = true)]
[DataElementType(DataElementTypes.KeyValue, ValueTextKind = TextKind.LocalizationKey)]
public string Name { get; set; } = default!;

[DataElementType(DataElementTypes.KeyValueUnit, UnitKey = "MM")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ namespace WoWsShipBuilder.DataContainers;
[DataContainer]
public partial record RocketDataContainer : ProjectileDataContainer
{
[DataElementType(DataElementTypes.KeyValue, IsValueLocalizationKey = true, IsValueAppLocalization = true)]
[DataElementType(DataElementTypes.KeyValue, ValueTextKind = TextKind.AppLocalizationKey)]
public string RocketType { get; set; } = default!;

[DataElementType(DataElementTypes.KeyValue, IsValueLocalizationKey = true)]
[DataElementType(DataElementTypes.KeyValue, ValueTextKind = TextKind.LocalizationKey)]
public string Name { get; set; } = default!;

[DataElementType(DataElementTypes.KeyValue)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public partial record ShellDataContainer : DataContainerBase
{
public string Name { get; set; } = default!;

[DataElementType(DataElementTypes.KeyValue, IsValueLocalizationKey = true, IsValueAppLocalization = true)]
[DataElementType(DataElementTypes.KeyValue, ValueTextKind = TextKind.AppLocalizationKey)]
public string Type { get; set; } = default!;

[DataElementType(DataElementTypes.KeyValue)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ namespace WoWsShipBuilder.DataContainers;
[DataContainer]
public partial record TorpedoDataContainer : ProjectileDataContainer
{
[DataElementType(DataElementTypes.KeyValue, IsValueLocalizationKey = true, IsValueAppLocalization = true)]
[DataElementType(DataElementTypes.KeyValue, ValueTextKind = TextKind.AppLocalizationKey)]
public string TorpedoType { get; set; } = default!;

[DataElementType(DataElementTypes.KeyValue, IsValueLocalizationKey = true)]
[DataElementType(DataElementTypes.KeyValue, ValueTextKind = TextKind.LocalizationKey)]
[DataElementFiltering(true, "ShouldDisplayName")]
public string Name { get; set; } = default!;

Expand Down Expand Up @@ -45,70 +45,70 @@ public partial record TorpedoDataContainer : ProjectileDataContainer
[DataElementFiltering(false)]
public decimal SplashCoeff { get; set; }

[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "MaxTurningSpeed", UnitKey = "DegreePerSecond", NameLocalizationKey = "FirstPing")]
[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "MaxTurningSpeed", UnitKey = "DegreePerSecond", LocalizationKeyOverride = "FirstPing")]
public decimal MaxTurningSpeedFirstPing { get; set; }

[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "MaxTurningSpeed", UnitKey = "DegreePerSecond", NameLocalizationKey = "SecondPing")]
[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "MaxTurningSpeed", UnitKey = "DegreePerSecond", LocalizationKeyOverride = "SecondPing")]
public decimal MaxTurningSpeedSecondPing { get; set; }

[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "TurningAcceleration", UnitKey = "DegreePerSecond2", NameLocalizationKey = "FirstPing")]
[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "TurningAcceleration", UnitKey = "DegreePerSecond2", LocalizationKeyOverride = "FirstPing")]
public decimal TurningAccelerationFirstPing { get; set; }

[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "TurningAcceleration", UnitKey = "DegreePerSecond2", NameLocalizationKey = "SecondPing")]
[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "TurningAcceleration", UnitKey = "DegreePerSecond2", LocalizationKeyOverride = "SecondPing")]
public decimal TurningAccelerationSecondPing { get; set; }

[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "MaxVerticalSpeed", UnitKey = "MPS", NameLocalizationKey = "FirstPing")]
[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "MaxVerticalSpeed", UnitKey = "MPS", LocalizationKeyOverride = "FirstPing")]
public decimal MaxVerticalSpeedFirstPing { get; set; }

[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "MaxVerticalSpeed", UnitKey = "MPS", NameLocalizationKey = "SecondPing")]
[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "MaxVerticalSpeed", UnitKey = "MPS", LocalizationKeyOverride = "SecondPing")]
public decimal MaxVerticalSpeedSecondPing { get; set; }

[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "VerticalAcceleration", UnitKey = "MPS2", NameLocalizationKey = "FirstPing")]
[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "VerticalAcceleration", UnitKey = "MPS2", LocalizationKeyOverride = "FirstPing")]
public decimal VerticalAccelerationFirstPing { get; set; }

[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "VerticalAcceleration", UnitKey = "MPS2", NameLocalizationKey = "SecondPing")]
[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "VerticalAcceleration", UnitKey = "MPS2", LocalizationKeyOverride = "SecondPing")]
public decimal VerticalAccelerationSecondPing { get; set; }

[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "SearchRadius", UnitKey = "KM", NameLocalizationKey = "FirstPing")]
[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "SearchRadius", UnitKey = "KM", LocalizationKeyOverride = "FirstPing")]
public decimal SearchRadiusFirstPing { get; set; }

[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "SearchRadius", UnitKey = "KM", NameLocalizationKey = "SecondPing")]
[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "SearchRadius", UnitKey = "KM", LocalizationKeyOverride = "SecondPing")]
public decimal SearchRadiusSecondPing { get; set; }

[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "SearchAngle", UnitKey = "Degree", NameLocalizationKey = "FirstPing")]
[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "SearchAngle", UnitKey = "Degree", LocalizationKeyOverride = "FirstPing")]
public decimal SearchAngleFirstPing { get; set; }

[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "SearchAngle", UnitKey = "Degree", NameLocalizationKey = "SecondPing")]
[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "SearchAngle", UnitKey = "Degree", LocalizationKeyOverride = "SecondPing")]
public decimal SearchAngleSecondPing { get; set; }

[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "Destroyer", UnitKey = "M", NameLocalizationKey = "FirstPing")]
[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "Destroyer", UnitKey = "M", LocalizationKeyOverride = "FirstPing")]
public decimal DestroyerCutOffFirstPing { get; set; }

[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "Destroyer", UnitKey = "M", NameLocalizationKey = "SecondPing")]
[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "Destroyer", UnitKey = "M", LocalizationKeyOverride = "SecondPing")]
public decimal DestroyerCutOffSecondPing { get; set; }

[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "Battleship", UnitKey = "M", NameLocalizationKey = "FirstPing")]
[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "Battleship", UnitKey = "M", LocalizationKeyOverride = "FirstPing")]
public decimal BattleshipCutOffFirstPing { get; set; }

[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "Battleship", UnitKey = "M", NameLocalizationKey = "SecondPing")]
[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "Battleship", UnitKey = "M", LocalizationKeyOverride = "SecondPing")]
public decimal BattleshipCutOffSecondPing { get; set; }

[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "Cruiser", UnitKey = "M", NameLocalizationKey = "FirstPing")]
[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "Cruiser", UnitKey = "M", LocalizationKeyOverride = "FirstPing")]
public decimal CruiserCutOffFirstPing { get; set; }

[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "Cruiser", UnitKey = "M", NameLocalizationKey = "SecondPing")]
[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "Cruiser", UnitKey = "M", LocalizationKeyOverride = "SecondPing")]
public decimal CruiserCutOffSecondPing { get; set; }

[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "Submarine", UnitKey = "M", NameLocalizationKey = "FirstPing")]
[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "Submarine", UnitKey = "M", LocalizationKeyOverride = "FirstPing")]
public decimal SubCutOffFirstPing { get; set; }

[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "Submarine", UnitKey = "M", NameLocalizationKey = "SecondPing")]
[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "Submarine", UnitKey = "M", LocalizationKeyOverride = "SecondPing")]
public decimal SubCutOffSecondPing { get; set; }

[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "AirCarrier", UnitKey = "M", NameLocalizationKey = "FirstPing")]
[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "AirCarrier", UnitKey = "M", LocalizationKeyOverride = "FirstPing")]
public decimal CvCutOffFirstPing { get; set; }

[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "AirCarrier", UnitKey = "M", NameLocalizationKey = "SecondPing")]
[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "AirCarrier", UnitKey = "M", LocalizationKeyOverride = "SecondPing")]
public decimal CvCutOffSecondPing { get; set; }

public List<ShipClass>? CanHitClasses { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public partial record ManeuverabilityDataContainer : DataContainerBase
[DataElementType(DataElementTypes.KeyValueUnit, UnitKey = "Knots")]
public decimal ManeuverabilityMaxSpeed { get; set; }

[DataElementType(DataElementTypes.KeyValueUnit, UnitKey = "Knots", NameLocalizationKey = "MaxReverseSpeed")]
[DataElementType(DataElementTypes.KeyValueUnit, UnitKey = "Knots", LocalizationKeyOverride = "MaxReverseSpeed")]
public decimal ManeuverabilityMaxReverseSpeed { get; set; }

[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "MaxSpeed", UnitKey = "Knots")]
Expand All @@ -24,13 +24,13 @@ public partial record ManeuverabilityDataContainer : DataContainerBase
[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "MaxSpeed", UnitKey = "Knots")]
public decimal ManeuverabilitySubsMaxSpeedAtMaxDepth { get; set; }

[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "MaxReverseSpeed", UnitKey = "Knots", NameLocalizationKey = "ManeuverabilitySubsMaxSpeedOnSurface")]
[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "MaxReverseSpeed", UnitKey = "Knots", LocalizationKeyOverride = "ManeuverabilitySubsMaxSpeedOnSurface")]
public decimal ManeuverabilitySubsMaxReverseSpeedOnSurface { get; set; }

[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "MaxReverseSpeed", UnitKey = "Knots", NameLocalizationKey = "ManeuverabilitySubsMaxSpeedAtPeriscope")]
[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "MaxReverseSpeed", UnitKey = "Knots", LocalizationKeyOverride = "ManeuverabilitySubsMaxSpeedAtPeriscope")]
public decimal ManeuverabilitySubsMaxReverseSpeedAtPeriscope { get; set; }

[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "MaxReverseSpeed", UnitKey = "Knots", NameLocalizationKey = "ManeuverabilitySubsMaxSpeedAtMaxDepth")]
[DataElementType(DataElementTypes.Grouped | DataElementTypes.KeyValueUnit, GroupKey = "MaxReverseSpeed", UnitKey = "Knots", LocalizationKeyOverride = "ManeuverabilitySubsMaxSpeedAtMaxDepth")]
public decimal ManeuverabilitySubsMaxReverseSpeedAtMaxDepth { get; set; }

[DataElementType(DataElementTypes.KeyValueUnit, UnitKey = "MPS")]
Expand Down
Loading

0 comments on commit 37a4df0

Please sign in to comment.