From 22f23da023b0a7fe25f07a947d36d429bddfc887 Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期三, 28 五月 2025 16:31:02 +0800
Subject: [PATCH] 1.Slot的存储和加载;
---
SourceCode/Bond/Servo/CSlot.cpp | 31 +++++++++++++++++++++++++++++--
1 files changed, 29 insertions(+), 2 deletions(-)
diff --git a/SourceCode/Bond/Servo/CSlot.cpp b/SourceCode/Bond/Servo/CSlot.cpp
index 74a1e57..ed297f2 100644
--- a/SourceCode/Bond/Servo/CSlot.cpp
+++ b/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;
+ }
}
--
Gitblit v1.9.3