LAPTOP-SNT8I5JK\Boounion
2025-05-28 22f23da023b0a7fe25f07a947d36d429bddfc887
1.Slot的存储和加载;
已修改3个文件
34 ■■■■■ 文件已修改
SourceCode/Bond/Servo/CEquipment.cpp 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CSlot.cpp 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/x64/Debug/Master.dat 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CEquipment.cpp
@@ -321,6 +321,9 @@
            Lock();
            for (int i = 0; i < SLOT_MAX; i++) {
                m_slot[i].serialize(ar);
                if (m_slot[i].getContext() != nullptr) {
                    ((CGlass*)m_slot[i].getContext())->serialize(ar);
                }
            }
            Unlock();
        }
SourceCode/Bond/Servo/CSlot.cpp
@@ -105,10 +105,37 @@
    void CSlot::serialize(CArchive& ar)
    {
        if (ar.IsStoring()) {
            ar << m_nPosition;
            ar << m_nNo;
            ar << (int)m_materialsType;
            WriteString(ar, m_strName);
            ar << (__int64)m_pContext;
            ar << m_bEnable;
            ar << m_bLock;
        }
        else {
            int i32;
            __int64 i64;
            ar >> m_nPosition;
            ar >> m_nNo;
            ar >> i32; m_materialsType = (MaterialsType)i32;
            ReadString(ar, m_strName);
            ar >> i64; m_pContext = (CContext*)i64;
            ar >> m_bEnable;
            ar >> m_bLock;
        }
    }
    void CSlot::WriteString(CArchive& ar, std::string& string)
    {
        CString strTemp = string.c_str();
        ar << strTemp;
    }
    void CSlot::ReadString(CArchive& ar, std::string& string)
    {
        CString strTemp;
        ar >> strTemp;
        string = (LPTSTR)(LPCTSTR)strTemp;
    }
}
SourceCode/Bond/x64/Debug/Master.dat
Binary files differ