| | |
| | | { |
| | | m_pPath = nullptr; |
| | | m_type = MaterialsType::G1; |
| | | m_pBuddy = nullptr; |
| | | } |
| | | |
| | | CGlass::~CGlass() |
| | |
| | | pPath = pTemp; |
| | | } |
| | | m_pPath = nullptr; |
| | | |
| | | if (m_pBuddy != nullptr && m_type == MaterialsType::G1) { |
| | | m_pBuddy->release(); |
| | | } |
| | | } |
| | | |
| | | std::string& CGlass::getClassName() |
| | |
| | | if (ar.IsStoring()) |
| | | { |
| | | Lock(); |
| | | ar << (int)m_type; |
| | | WriteString(ar, m_strID); |
| | | ar << (ULONGLONG)m_pPath; |
| | | if (m_pPath != nullptr) { |
| | |
| | | ar.Write(temp, JOBDATAB_SIZE); |
| | | m_jobDataS.serialize(temp, JOBDATAS_SIZE); |
| | | ar.Write(temp, JOBDATAS_SIZE); |
| | | ar << (ULONGLONG)m_pBuddy; |
| | | WriteString(ar, m_strBuddyId); |
| | | Unlock(); |
| | | } |
| | | else |
| | | { |
| | | Lock(); |
| | | ReadString(ar, m_strID); |
| | | ULONGLONG ullPath; |
| | | int type; |
| | | |
| | | Lock(); |
| | | ar >> type; |
| | | m_type = (MaterialsType)type; |
| | | ReadString(ar, m_strID); |
| | | ar >> ullPath; |
| | | if (ullPath != 0) { |
| | | m_pPath = new CPath(); |
| | |
| | | m_jobDataB.unserialize(temp, JOBDATAB_SIZE); |
| | | ar.Read(temp, JOBDATAS_SIZE); |
| | | m_jobDataS.unserialize(temp, JOBDATAS_SIZE); |
| | | ar >> ullPath; // 这是m_pBuddy, 用不上 |
| | | ReadString(ar, m_strBuddyId); |
| | | Unlock(); |
| | | } |
| | | } |
| | |
| | | { |
| | | return &m_jobDataS; |
| | | } |
| | | |
| | | BOOL CGlass::setBuddy(CGlass* pGlass) |
| | | { |
| | | if (m_pBuddy != nullptr) return FALSE; |
| | | if (pGlass->getType() == this->getType()) return FALSE; |
| | | m_pBuddy = pGlass; |
| | | if (m_type == MaterialsType::G1) { |
| | | m_pBuddy->addRef(); |
| | | } |
| | | m_strBuddyId = m_pBuddy->getID(); |
| | | |
| | | return TRUE; |
| | | } |
| | | |
| | | CGlass* CGlass::getBuddy() |
| | | { |
| | | return m_pBuddy; |
| | | } |
| | | |
| | | std::string& CGlass::getBuddyId() |
| | | { |
| | | return m_strBuddyId; |
| | | } |
| | | } |