/** * brief Load the attributes for an Fish node. * * \param node The Xml node we are loading the item from */ void CFish::XmlLoad(const std::shared_ptr<xmlnode::CXmlNode> &node) { SetLocation(node->GetAttributeDoubleValue(L"x", 0), node->GetAttributeDoubleValue(L"y", 0)); SetSpeed(node->GetAttributeDoubleValue(L"speedx", 0), node->GetAttributeDoubleValue(L"speedy", 0)); SetBreed(node->GetAttributeDoubleValue(L"gestatingTime", 0), node->GetAttributeDoubleValue(L"interestTime", 0), node->GetAttributeDoubleValue(L"isInterested", 0), node->GetAttributeDoubleValue(L"isGestating", 0), node->GetAttributeDoubleValue(L"canBreed", 0), node->GetAttributeDoubleValue(L"isMale", 0)); SetFeeding(node->GetAttributeDoubleValue(L"feedingTime", 0), node->GetAttributeDoubleValue(L"isHungry", 0)); SetAge(node->GetAttributeDoubleValue(L"age", 0)); }
void CMemPmBasicPage::TransData(BOOL bToControls) { DWORD dwNum; CString szText; WORD wBreed; m_ppc = GetPokemonCodec(); if(m_ppc == NULL) return; if(bToControls) { //////////////////////////////////////////////// m_ctrlBreedList.SetImageList(g_MemRom.m_pTinyIconList); COMBOBOXEXITEM cbei; cbei.mask = CBEIF_IMAGE | CBEIF_SELECTEDIMAGE; for(wBreed = 0; wBreed < BREED_COUNT; ++wBreed) { cbei.iItem = wBreed; cbei.iImage = g_MemRom.GetSmallIconIndex(wBreed, rand() % g_MemRom.GetSmallIconCount(wBreed)); cbei.iSelectedImage = cbei.iImage; m_ctrlBreedList.SetItem(&cbei); } OnBnClickedEnableText(); SetBreed(); szText.Format(_T("0x%08lX"), m_ppc->GetChar()); SetDlgItemText(IDC_CHAR, szText); szText.Format(_T("0x%08lX"), m_ppc->GetID()); SetDlgItemText(IDC_ID, szText); SetExp(); SetDlgItemInt(IDC_INTIMATE, m_ppc->GetIntimate(), FALSE); SetPs(); m_ctrlItemList.SetCurSel(m_ppc->GetItem()); SetItemDesc(); CheckDlgButton(IDC_EGG, m_ppc->GetIsEgg() ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(IDC_SHINY, m_ppc->GetIsShiny() ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(IDC_OBEDIENCE, m_ppc->GetObedience() ? BST_CHECKED : BST_UNCHECKED); } else { GetDlgItemText(IDC_INTIMATE, szText); dwNum = min(_tcstoul(szText, 0, 0), 0xFF); m_ppc->SetIntimate((BYTE)(dwNum)); if(IsDlgButtonChecked(IDC_ENABLE_TEXT) == BST_CHECKED) { GetDlgItemText(IDC_NICK_NAME, szText); m_ppc->SetNickName(szText); GetDlgItemText(IDC_CATCHER_NAME, szText); m_ppc->SetCatcherName(szText); } } }