修复代码警告:1. 简化对象初始化 2. 设置只读字段

This commit is contained in:
zqm
2025-10-30 15:51:42 +08:00
parent 63ebe4faa1
commit 3c14188938
4 changed files with 8 additions and 10 deletions

View File

@@ -1129,9 +1129,10 @@ namespace JoyD.Windows.CS.Toprie
if (SendCommand(command, out string response))
{
// 创建默认的ImagePos对象
SharedStructures.ImagePos data = new SharedStructures.ImagePos();
data.area = new SharedStructures.AreaPos[6];
data.spot = new SharedStructures.SpotPos[6];
SharedStructures.ImagePos data = new SharedStructures.ImagePos() {
area = new SharedStructures.AreaPos[6],
spot = new SharedStructures.SpotPos[6]
};
// 这里应该解析完整的响应数据
// 简化实现,返回默认值