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:
@@ -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<T>()</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; }
|
||||
}
|
||||
|
||||
12
SVSim.Database/Models/Config/NormalBonusEntry.cs
Normal file
12
SVSim.Database/Models/Config/NormalBonusEntry.cs
Normal 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; }
|
||||
}
|
||||
Reference in New Issue
Block a user