chore(config): split NormalBonusEntry, strengthen Normal-defaults warning

File-per-class convention + explicit warning against the property-initializer
collection-default bug class (2026-05-24).
This commit is contained in:
gamer147
2026-06-13 15:55:12 -04:00
parent 6fb73c7a09
commit 0d01727e48
2 changed files with 17 additions and 11 deletions

View File

@@ -17,8 +17,11 @@ public class LoginBonusConfig
public string Img { get; set; } = "0";
/// <summary>
/// Normal-cycle reward entries, 1-based by Day. Defaults to a 15-day cycle copied
/// verbatim from the prod tutorial capture (traffic_prod_tutorial.ndjson).
/// Normal-cycle reward entries, 1-based by Day. Defaults to <c>new()</c> (empty);
/// real entries live in <see cref="ShippedDefaults"/>. <b>Do not move them into this
/// property initializer</b> — collection initializers silently empty out under
/// <c>GameConfigService.Get&lt;T&gt;()</c>'s tier-merge (config-defaults convention,
/// historical bug 2026-05-24).
/// </summary>
public List<NormalBonusEntry> Normal { get; set; } = new();
@@ -47,12 +50,3 @@ public class LoginBonusConfig
},
};
}
public class NormalBonusEntry
{
public int Day { get; set; }
public int EffectId { get; set; } = 1;
public UserGoodsType RewardType { get; set; }
public long RewardDetailId { get; set; }
public int RewardNumber { get; set; }
}

View File

@@ -0,0 +1,12 @@
using SVSim.Database.Enums;
namespace SVSim.Database.Models.Config;
public class NormalBonusEntry
{
public int Day { get; set; }
public int EffectId { get; set; } = 1;
public UserGoodsType RewardType { get; set; }
public long RewardDetailId { get; set; }
public int RewardNumber { get; set; }
}